![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Inserting Code Before an -n/-p Loopby LanX (Sage) |
on Dec 17, 2018 at 21:07 UTC ( #1227367=note: print w/replies, xml ) | Need Help?? |
I somehow remember seeing it in the perldocs, but not sure where. What's happening is that the snippet is literally injected into a loop (see perlrun) }{ is just closing the loops body and opening a block to pair with the old end. Nota bene that using BEGIN and END blocks have similar effects but are probably easier to read.
Cheers Rolf
updatefrom perlrun#*-n*
In Section
Meditations
|
|