[ic] accessing array

Mat Jones - booksellersolutions.com mat@booksellersolutions.com
Fri, 06 Apr 2001 11:43:12 -0700

Ok I think I should expand more on this....
i dont think i provided enough info...here are snippets of my code
on a particular page I do a sql search in perl :

my $resultset = $dbh->selectall_arrayref($query)

and want to use these results on another page so I do:

$Values->{final} = @$resultset;

This maybe where I am going wrong..
on another page I try to access the stored value :

return $Values->{final};

returns ARRAY(0x8d9154c)ARRAY(0x8dd4314)ARRAY(0x8d5a8bc)ARRAY(0x8d81490) to
the screen and:

return $Values->{final}[0];

returns nothing.... I am thinking this is because the initial value was an
array ref and somehow is not being dereferenced...



----- Original Message -----
From: "Dan B" <db@cyclonehq.dnsalias.net>
To: <interchange-users@lists.akopia.com>
Sent: Friday, April 06, 2001 11:15 AM
Subject: Re: [ic] accessing array

> At 11:15 AM 4/6/2001 -0700, you wrote:
> >when I try to print an array of arrays in perl stored as $Values->{final}
> >it returns
> >ARRAY(0x8d9154c)ARRAY(0x8dd4314)ARRAY(0x8d5a8bc)
> >to the screen.
> >How can I access just one element of one of those arrays??
> $Values->{final}[0] ?  I await my humbling correction. :-)
> Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users