I tried to create a simple script to open a file,
and I always got this error msg,
"Use of uninitialized value in concatenation (.) or string at readfile.pl line 5.
readline() on closed filehandle LOG at readfile.pl line 7."
Here is my code:
###########################################################
open(LOG, "< $_");
@log = <LOG>;
foreach $line (@log)
{
print $line;
}
##########################################################
And I passed a file to the script:
C:>perl readfile.pl foo.log
Please help me.
thanks
lucas
and I always got this error msg,
"Use of uninitialized value in concatenation (.) or string at readfile.pl line 5.
readline() on closed filehandle LOG at readfile.pl line 7."
Here is my code:
###########################################################
open(LOG, "< $_");
@log = <LOG>;
foreach $line (@log)
{
print $line;
}
##########################################################
And I passed a file to the script:
C:>perl readfile.pl foo.log
Please help me.
thanks
lucas