Hi there Monks!
I am sending all the DATA to be processed by process() sub, since I am expecting a lot of data I want to process 100 rows at a time.
The issue I have is that its giving me this error:
Not a HASH reference at... this line: my $name = $row->{NAME};
I don’t understand!!!
Thanks for looking!
...
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',
},
];