in reply to Re: Re: Re: Re: opening a file in a subroutine
in thread opening a file in a subroutine
sub myfile { my $file = shift; open my $fh, $file or die "Couldn't open '$file': $!"; my @lines = <$fh>; close $fh or die "Couldn't close '$file': $!"; return \@lines; } # and call it like this: my @lines = @{myfile('xml.log')};
Update: If it's a bug as demerphq suspects, then I suspect that it's OS dependent - I get the same times here on all opens (perl v5.6.0 built for sun4solaris).
-- Hofmator
|
|---|