opening a file in perl

Matthew Hawkins matthew at
Wed May 1 10:38:44 EST 2002

On Wed, 01 May 2002, Nemo - earth native wrote:
> 	foreach my $line ( <IN> )

The other thing is (and I don't know how valid this is with newer
versions of Perl) you're better off declaring $line outside the foreach,
as the way you have it a new $line is malloced each iteration, and its
up to the garbage collector to nuke the old one.


More information about the linux mailing list