question about DBI's fetchrow_arrayref()

nkuipers nkuipers at uvic.ca
Wed Sep 4 23:18:23 CDT 2002


Hello everyone,

I'm a little puzzled about what's actually going on with the following code 
snippet (from Programming the Perl DBI, page 114):

1 my @stash;
2 while ( my $array_ref = $sth->fetchrow_arrayref ) {
3   push @stash, [ @$array_ref ];
4 }

5 foreach $array_ref ( @stash ) {
6   print :Row: @$array_ref\n";
7 }

It's line 3.  It looks like a dereferenced arrayref stored in a reference to 
an anonymous array?  Did I get that right?  I realize what it is intended to 
do: store a copy of the values that the original reference points to and not 
just the reference itself.  Just wanted to make sure I understand the 
mechanics of that line.

Thanks, hope everything is well,

Nathanael Kuipers




More information about the Victoria-pm mailing list