I'm trying to clean up a list to take rubbish away from the top and the bottom (it's a stack trace from a dbic/dancer app).
This works:
perl -MList::MoreUtils -E ' @foo = reverse List::MoreUtils::before { $_ =~ /DBIC/ } reverse List::MoreUtils::before { $_ =~ /Dancer/ } qw<eval DBIC::3 DBIC::2 DBIC::1 MyApp::3 MyApp::2 MyApp::1 Dancer::3 + Dancer::2 Dancer::1>; say for @foo'
But it looks to me like there should be a more readable way of writing this. I had a look at using a flip-flop, but it seems that that would also require two reverses.
Any suggestions how to make this more readable?In reply to List::MoreUtils before, after and ... between? by Boldra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |