perl读文件报错?
#add by wjj 2007.7.24
open(FILE_H, "${INIFILE} ");
while (defined($eachline = <FILE_H> )) {
#chomp $eachline;
print "@substr($eachline,1,6) ";
if @substr($eachline,1,6) = "tables "
{
@tables = split( ", ", @substr($eachline,7));
}
}
close FILE_H;
Global symbol "$eachline " requires explicit package name at Get_table_sql.pl lin
e 139.
Global symbol "$eachline " requires explicit package name at Get_table_sql.pl lin
e 141.
Global symbol "$eachline " requires explicit package name at Get_table_sql.pl lin
e 142.
Global symbol "$eachline " requires explicit package name at Get_table_sql.pl lin
e 144.
Execution of Get_table_sql.pl aborted due to compilation errors.
[解决办法]
my $eachline
这个标题使用前加这个应该就可以了。你使用了use strict,所以要规范