in reply to array references in DBI
Note. The code that worked came close to not working either.
Each iteration tried to save the same reference!
push @OrderedQuestions, \@an ;
It only worked because @an was declared lexical and not global:
push @OrderedQuestions, \@an ;
It only worked because @an was declared lexical and not global:
This almost identical code will not work
with the keyword my is missing:
while ( @an = $sth->fetchrow_array) { push (@OrderedQuestions, \@an); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: array references in DBI
by BrianC (Acolyte) on May 13, 2006 at 16:14 UTC | |
by bart (Canon) on May 15, 2006 at 11:35 UTC |
In Section
Seekers of Perl Wisdom