Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re (2): How do you move within an array using foreach?by VSarkiss (Monsignor) |
on Oct 10, 2002 at 18:40 UTC ( [id://204273]=note: print w/replies, xml ) | Need Help?? |
That's how I read it also. If that's what the questioner is after, I have to do it often enough that I usually write it as a one-liner: perl -ne "print if /\[foo\]/../\[foo2\]/" foofile(Nothing wrong with your code, just wanted to point out a short-circuit version.) BTW, I used double-quotes in that example because I presume the questioner is doing this on a windows system; i.e. typing at cmd.exe or something.
In Section
Seekers of Perl Wisdom
|
|