T
Tom
Hello,
I have a chunk of code that executes six statement handles from the
DBI module as follows:
$sth1->execute;
$sth2->execute;
$sth3->execute;
$sth4->execute;
$sth5->execute;
$sth6->execute;
The code runs fine but is it possible to run that through a loop using
Perl? I.e. something like:
for( my $i = 1; $i < 7; $i++ ) {
$sth${i}->execute;
}
The above doesn't work, was just my attempt. I've done quite a bit of
this type of looping via shell but am not sure of the correct syntax
for Perl.
Thanks for any help.
Tom
I have a chunk of code that executes six statement handles from the
DBI module as follows:
$sth1->execute;
$sth2->execute;
$sth3->execute;
$sth4->execute;
$sth5->execute;
$sth6->execute;
The code runs fine but is it possible to run that through a loop using
Perl? I.e. something like:
for( my $i = 1; $i < 7; $i++ ) {
$sth${i}->execute;
}
The above doesn't work, was just my attempt. I've done quite a bit of
this type of looping via shell but am not sure of the correct syntax
for Perl.
Thanks for any help.
Tom