in reply to How do I read an entire file into a string?
my $contents = do { local(@ARGV, $/) = $file; <> };
Also check out answers/discussions on SO, such as this one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I read an entire file into a string?
by BrowserUk (Patriarch) on Jun 15, 2016 at 11:37 UTC |