in reply to slurping styles
Cleaned up (with do ⇒ elegant):
my $raw = do { open(my $fh, '<', $file) or die("Could not read file: $!\n"); binmode $fh; local $/; <$fh> };
Cleaned up (without do ⇒ saves memory):
my $raw; { open(my $fh, '<', $file) or die("Could not read file: $!\n"); binmode $fh; local $/; $raw = <$fh>; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: slurping styles
by BrowserUk (Patriarch) on Aug 01, 2008 at 12:01 UTC | |
|
Re^2: slurping styles
by massa (Hermit) on Aug 01, 2008 at 11:30 UTC | |
by ikegami (Patriarch) on Aug 01, 2008 at 11:36 UTC | |
by moritz (Cardinal) on Aug 01, 2008 at 11:44 UTC |