Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I don’t understand!!!Not a HASH reference at... this line: my $name = $row->{NAME};
... sub process { my $arrayref = shift; while ( my @data = splice( @{ $arrayref }, 0, 100 ) ) { foreach my $row (@data) { my $name = $row->{NAME}; my $year = $row->{YEAR}; print "$name and $address\n"; } } } __DATA__ $VAR1 = [ { 'NAME' => 'LAST PAUL', 'YEAR' => '2000', }, { 'NAME' => 'DEMARCO R', 'YEAR' => '1960', }, { 'NAME' => 'JOE M', 'YEAR' => '1981', }, { 'NAME' => 'LOU MARY', 'YEAR' => '1948', }, ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not a HASH reference
by 1nickt (Canon) on Jul 07, 2015 at 18:05 UTC | |
|
Re: Not a HASH reference
by stevieb (Canon) on Jul 07, 2015 at 18:19 UTC |