Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Get middle word
by GrandFather (Saint) on Mar 01, 2010 at 02:24 UTC
Re: Get middle word
by ww (Archbishop) on Mar 01, 2010 at 02:41 UTC
    Looks a lot like homework... or, more specifically, part two of the last prior SOPW.

    ...and even if the two are merely coincidental, not sharing an author, - - for failure to show any effort.

Re: Get middle word
by jethro (Monsignor) on Mar 01, 2010 at 02:30 UTC
    my ($result)= m{ FIXED (.*?) FIXED }x;

    Just to make sure I used a non-greedy match (the ? makes the * match as few characters as possible). That won't make a difference until more than 2 'FIXED' strings are in one line

      my ($result)= m{ FIXED (.*?) FIXED }x;
      That fails on strings like "FIXEDfooFIXEDbarFIXED" without making any assumptions beyond the stated requirements. A greedy match seems right here.
      -sauoq
      "My two cents aren't worth a dime.";
Re: Get middle word
by toolic (Bishop) on Mar 01, 2010 at 02:46 UTC