Keep It Simple, Stupid | |
PerlMonks |
Re: Easiest way to do something only on first iteration of loopby ctilmes (Vicar) |
on May 09, 2016 at 13:58 UTC ( [id://1162547]=note: print w/replies, xml ) | Need Help?? |
Several good ways to do this have already been mentioned for Perl 5. I'll also note that your question was one of the many things addressed in Perl6.
Perl 6 added an explicit phaser for first loop invocation you can use like this:
In Section
Seekers of Perl Wisdom
|
|