John W. Krahn wrote:
my @llist = do {
open my $fh, '<', $lfile or die "Unable to open '$lfile': $!";
<$fh>;
};
Again, especially for biggish files, this is a better way:
my @llist;
{ open my $fh, '<', $lfile
or die "'$lfile': $!";
@llist = <$fh>;
}
Randall's idea to make Perl choose to alias (in stead of copy) when the
source will be garbaged anyway, is a real good one.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/