perl_reading_entire_file_into_a_string
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| perl_reading_entire_file_into_a_string [2025/03/20 19:31] – removed - external edit (Unknown date) 127.0.0.1 | perl_reading_entire_file_into_a_string [2025/03/20 19:32] (current) – juckins | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== Perl Reading an entire file into a string ==== | ||
| + | Option 1: | ||
| + | < | ||
| + | Use File::Slurp | ||
| + | $file_contents = read_file($wget_saved_filename); | ||
| + | </ | ||
| + | |||
| + | Option 2: | ||
| + | |||
| + | < | ||
| + | open (READ_WGET_FILE, | ||
| + | $file_contents = do { local $/; < | ||
| + | close (READ_WGET_FILE); | ||
| + | </ | ||
