http://www.perlmonks.org?node_id=911044

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

Hi,

I have a question on flip-flop operator. I have a script something like this

while (<>) { if(/START/.../END TIME (.+)/) { next if(/START/ | /^\s*$/); print; } }

The flop string 'END TIME (.+)' has a variable time at the end which I would like to extract and print. I see that the script match the 'END TIME (.+)', returns false and returns to the while loop beginning, but the matched sub-pattern (.+) is not stored anywhere ($1, $&, $+ etc). How do I extract this ?

Thanks in advance

-Raja