D
Dean
Running the code below I see the error:
Too many arguments for main:rint_rHoHoH at ./usenet.pl line 21, near
"$xml)"
#!/usr/bin/perl -w
use XML::Simple;
sub print_rHoHoH(){
$rHoHoH=$_[0];
for my $k1 ( sort keys %$rHoHoH ) {
print "$k1\n";
for my $k2 ( sort keys %{$rHoHoH->{ $k1 }} ) {
print "\t$k2\n";
for my $k3 ( sort keys %{$rHoHoH->{ $k1 }->{ $k2 }} ) {
print "\t\t$k3 => $rHoHoH->{ $k1 }->{ $k2 }->{ $k3 }\n";
}
}
}
}
$xml=XMLin($ARGV[0]);
print_rHoHoH($xml);
I don't understand why passing the reference to the hash in the call to the
subroutine causes the error.
If I change the last line to
do print_rHoHoH($xml);
it works, but with a warning about 'do' being deprecated.
Any insight would be much appreciated.
Thanks.
Too many arguments for main:rint_rHoHoH at ./usenet.pl line 21, near
"$xml)"
#!/usr/bin/perl -w
use XML::Simple;
sub print_rHoHoH(){
$rHoHoH=$_[0];
for my $k1 ( sort keys %$rHoHoH ) {
print "$k1\n";
for my $k2 ( sort keys %{$rHoHoH->{ $k1 }} ) {
print "\t$k2\n";
for my $k3 ( sort keys %{$rHoHoH->{ $k1 }->{ $k2 }} ) {
print "\t\t$k3 => $rHoHoH->{ $k1 }->{ $k2 }->{ $k3 }\n";
}
}
}
}
$xml=XMLin($ARGV[0]);
print_rHoHoH($xml);
I don't understand why passing the reference to the hash in the call to the
subroutine causes the error.
If I change the last line to
do print_rHoHoH($xml);
it works, but with a warning about 'do' being deprecated.
Any insight would be much appreciated.
Thanks.