in reply to Weird 5.8.8 Solaris <> bug
On the several 5.8.x versions of Perl that I had handy none of which were 5.8.8 and none of which were on Solaris, I was unable to reproduce the problem so I can't test my fix. However, I suspect the following would fix the problem:
sub file_contents { local @ARGV = $FILE; local $/; my $contents = <>; close ARGV; # Make EOF more obvious to Solaris Perl 5.8.8 return $contents; }
The problem isn't how you are writing to the files. It seems clear that the problem is that the *ARGV file handle isn't being fully closed between the first and second round. Otherwise, it makes no sense to have just the second line read.
- tye
|
|---|