Just another thing: replace that foreach with while to read from a filehandle.
#!/usr/bin/perl use strict; use warnings; my $logfile = 'access.log'; open my $logh, '<', $logfile or die "$logfile: open failed: $!"; while ( my $line = <$logh> ) { # do line-by-line processing } close $logh or die "$logfile: close failed: $!"; # or die ... not really necessary here, but my fingers type that autom +atically nowadays...
In reply to Re: Use of uninitialized value in open
by linuxer
in thread Use of uninitialized value in open
by pcouderc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |