Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: List::MoreUtils before, after and ... between?

by BrowserUk (Pope)
on Feb 21, 2012 at 14:55 UTC ( #955325=note: print w/replies, xml ) Need Help??

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

Your specific example is more simply accomplished with grep:

@foo = grep /MyApp/, qw<eval DBIC::3 DBIC::2 DBIC::1 MyApp::3 MyApp::2 + MyApp::1 Dancer::3 Dancer::2 Dancer::1>;; print for @foo;; MyApp::3 MyApp::2 MyApp::1

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: List::MoreUtils before, after and ... between?
by rovf (Priest) on Feb 21, 2012 at 15:16 UTC

    This assumes that it is *known* that we search for "MyApp". I understood the problem in the following way: Throw away everything in the beginning of the list up to, and including, DBIC. Then keep everythin which follows, up to (but not including) the first Dancer. Then throw away what follows. For instance, a MyApp which precedes a DBIC or follows a Dancer, should also be thrown away. This can't be done with your grep solution.

    Ronald Fischer <>
      Your specific example...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955325]
and the leaves swirl about...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-06-20 04:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.