Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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

by ikegami (Pope)
on Feb 21, 2012 at 23:20 UTC ( #955407=note: print w/replies, xml ) Need Help??

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

That's not the requested output.
  • Comment on Re^2: List::MoreUtils before, after and ... between?

Replies are listed 'Best First'.
Re^3: List::MoreUtils before, after and ... between?
by LanX (Bishop) on Feb 22, 2012 at 00:02 UTC
    ...This should be close..


    Still not sure what the requested output is, but if it's only about eliminating the edges try

    DB<101> @list= ("a".."c","DBIC","A".."C","DANCER","a".."c") => ("a", "b", "c", "DBIC", "A", "B", "C", "DANCER", "a", "b", "c") DB<102> grep { /DBIC/ .. /DANCER/ and ! /DBIC/ and ! /DANCER/ } @lis +t => ("A", "B", "C")

    not DRY but effective.

      That looks very readable and produces the output I said I need, but not for some of the edge cases that other monks thought of:
      say for grep { /DBIC/ .. /Dancer/ and !/DBIC/ and !/Dancer/ } qw<eval +DBIC::3 eval DBIC::2 DBIC::1 MyApp::3 MyApp::2 MyApp::1 Dancer::3 Dan +cer::2 Dancer::1>;
      say for grep { /DBIC/ .. /Dancer/ and !/DBIC/ and !/Dancer/ } qw<MyApp +::3 MyApp::2 MyApp::1 Dancer::3 Dancer::2 Dancer::1>;
      I hadn't thought of these edge cases when I posted, but the first one is a distinct possibility. The example code with reverse before works ok for these.

      Thanks for showing me a new way of using the flip-flop.

      - Boldra

      The code is not even close to what it should be, and it's totally irrelevant if it's simply the output that is close to what it should be.

        close enough ...see update.

        Cheers Rolf

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955407]
[Your Mother]: Consider how long, for example, superhero movies were kept at bay because they weren't commercially viable. They always were, just Hollywood couldn't see it or understand how to make one because there is no management talent in the town.
[LanX]: Erich von Strohheim built his career on beeing the most hated guy (The man you love to hate)
[Your Mother]: You see these amazing set, costumes, performances, etc, etc, etc all ruined by production and script decisions from the top down.
[LanX]: well ... the traget audiance is 15-25
[LanX]: spend one weekend in bed and TV showed me 3 remakes of 80s classics
[Your Mother]: Yep. Publish or die. Content be damned.
[Your Mother]: Comfort food and diabetes for the soul.
[LanX]: talking about comic adaptions ... I really liked the Watchmen
[LanX]: look I can give you a long list of excellent US movies
[Your Mother]: I adored the comic and the movie was almost a frame for frame remake (excepting the plot liberties to shorten it) but I still didn't quite like it. What's his nose, Jamie Earl whoever was flawless though.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2018-03-19 14:58 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.