Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$mysql = $dbh->exec ( $sql ); for (my $i = 0; $i < @{$mysql}; $i++) { my $field1 = $mysql->[$i]{‘field1’}; my $field2 = $mysql->[$i]{‘field2’}; or… $mysql = $dbh->exec ( $sql ); foreach (@$mysql) { my $field1 = $_->{ ‘field1’ }; my $field2 = $_->{ ‘field2’ };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Style and Preference on Loops
by cdarke (Prior) on Aug 12, 2011 at 15:16 UTC | |
|
Re: Style and Preference on Loops
by TomDLux (Vicar) on Aug 12, 2011 at 19:34 UTC | |
by eyepopslikeamosquito (Archbishop) on Aug 12, 2011 at 22:21 UTC | |
by jwkrahn (Abbot) on Aug 12, 2011 at 23:01 UTC | |
by eyepopslikeamosquito (Archbishop) on Aug 13, 2011 at 00:43 UTC | |
by TomDLux (Vicar) on Aug 15, 2011 at 13:50 UTC | |
|
Re: Style and Preference on Loops
by VinsWorldcom (Prior) on Aug 12, 2011 at 17:09 UTC | |
by chromatic (Archbishop) on Aug 12, 2011 at 17:43 UTC | |
by GrandFather (Saint) on Aug 12, 2011 at 23:24 UTC | |
by eyepopslikeamosquito (Archbishop) on Aug 12, 2011 at 23:53 UTC | |
|
Re: Style and Preference on Loops
by afoken (Chancellor) on Aug 13, 2011 at 04:13 UTC |