in reply to File::Slurp bug? Should I bother?
Here is another test:
use strict; use warnings; use File::Slurp; my $file_slurp = read_file('file'); my $normal; { local $/; open my $FILE, '<', 'file' or die $!; $normal = <$FILE>; close $FILE; } write_file('slurp', $file_slurp); open my $NORMAL, '>', 'normal' or die $!; print $NORMAL $normal; close $NORMAL; open my $SLURP_NORMAL, '>', 'slurp_normal' or die $!; print $SLURP_NORMAL $file_slurp; close $SLURP_NORMAL;
Doing this, both normal and slurp end up with the file identical to the original, but slurp_normal has the "added" newlines. So something in File::Slurp is "correcting" whatever it did to begin with when I use write_file. I'm puzzled.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Slurp bug? Should I bother?
by ikegami (Patriarch) on Sep 07, 2005 at 17:02 UTC | |
by chester (Hermit) on Sep 07, 2005 at 17:40 UTC | |
by ikegami (Patriarch) on Sep 07, 2005 at 18:12 UTC | |
by chester (Hermit) on Sep 07, 2005 at 18:30 UTC |