I guess it's the unlock_tables() that you want to run on all except the last iteration, right? you can move it to the beginning of the loop and skip it in the first iteration:
my $firsttime = 1; foreach my $id (@list_o_object_ids) { unless ($firsttime) { unlock_tables(); lock_db_tables(); } else { $firsttime = 0; } my $obj = new Thingy($id); # gets stuff from db # make changes, save back to db. }
Jenda
|
We'd like to help you learn to help yourself Look around you, all you see are sympathetic eyes Stroll around the grounds until you feel at home -- P. Simon in Mrs. Robinson |
In reply to Re^3: I need a different continue
by Jenda
in thread I need a different continue
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |