more useful options | |
PerlMonks |
Re: Previous Line Matching Issuesby InfiniteSilence (Curate) |
on May 21, 2014 at 00:13 UTC ( [id://1086886]=note: print w/replies, xml ) | Need Help?? |
My approach involves using a simple data structure to tell you about the past -- a stack:
What's happening here:
One additional note: the first example essentially caches everything in the @stack. You can keep only what you need in there by discarding things at the head like this:
gives,
Celebrate Intellectual Diversity
In Section
Seekers of Perl Wisdom
|
|