Hello,
>From the perlreftut, I have some in which I am creating a hash of arrays
where each array only has 2 values.
# creation of hash of arrays
$sth = &DoSQL($sql);
while (($item, $cost, $charge) = $sth->fetchrow_array()) {
push @{$costtable{$item}}, ($cost, $charge);
}
# spitting out the whole lot
foreach my $key(sort keys %costtable) {
print "$key:\n";
my @tmp = @{$costtable{$key}};
print "@tmp<br>\n";
}
But I only want to get the second element in the array, So I tried the
following but it doesn't work.
print "<br>$costtable{shipping}->[1] here it is";
I have tried other tactics, but cannot access it. Does anyone know how to
grab the second array element in a hash of arrays?
thanks,
Scott Purcell
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users