On Jul 16, Will Muir said:
>for my $i (0 .. $#quotes){
>
>$sth->execute($quotes[$i][0],$quotes[$i][1],$quotes[$i][2],$quotes[$i][3],$quotes[$i][4],$quotes[$i][5],$quotes[$i][6],$quotes[$i][7])||
> die "error: ", $dbh->errstr;
>}
First, you should turn that into an array slice:
@{ $quotes[$i] }[0 .. 7]
Second, if that's all there is, you should just use
@{ $quotes[$i] }
Third, don't loop over the INDICES of the array. Loop over the elements
themselves:
for my $datum (@quotes) {
$sth->execute(@$_);
}
Much simpler to read, no?
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
** Manning Publications, Co, is publishing my Perl Regex book **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]