|
代码如下:
[CODE]
open IN_FILE,"<rules.cfg" or die "Could not open rules.cfg!\n";
my $line;
# my $token;
my @tmp;
my @tables;
my %rules;
my $flag = 0;
my $parray;
while ( $line = <IN_FILE> )
{
@tmp = split /\s+/,$line;
if($tmp[0] eq "FOR" )
{
$parray = [];
push @tables,$parray;
push $$parray,$line;
$flag++;
}
chomp $line;
push $$parray,$line;
}
close IN_FILE;
foreach my $tarray (@tables)
{
foreach my $tline ($tarray)
{
print "$tline\n";
}
print "\n";
}
[/CODE]
错误如下:
Type of arg 1 to push must be array (not scalar dereference) at readhash.pl line 23, near "$line;"
Type of arg 1 to push must be array (not scalar dereference) at readhash.pl line 27, near "$line;"
Execution of readhash.pl aborted due to compilation errors. |
|