Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: List::MoreUtils before, after and ... between? (SMoP)

by tye (Cardinal)
on Feb 21, 2012 at 15:59 UTC ( #955340=note: print w/ replies, xml ) Need Help??


in reply to List::MoreUtils before, after and ... between?

my @stack; for my $level ( qw< eval DBIC::3 DBIC::2 DBIC::1 MyApp::3 MyApp::2 MyApp::1 Dancer::3 Dancer::2 Dancer::1 > ) { last if $level =~ /Dancer/; push @stack, $level; @stack = () if $level =~ /DBIC/; } say for @stack;

(Updated to move 'last' statement above 'push' statement. Thanks, AnomalousMonk.)

- tye        


Comment on Re: List::MoreUtils before, after and ... between? (SMoP)
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955340]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-10-01 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls