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
In reply to Re: List::MoreUtils before, after and ... between? (SMoP)
by tye
in thread List::MoreUtils before, after and ... between?
by Boldra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |