jhuijsing has asked for the wisdom of the Perl Monks concerning the following question:
With the following code
open( IP_FH, "test.txt" ); while (<IP_FH>) { if ( /ABCD/ ... /EFGH/ ) { $match = 1; $found .= $_; } else { if ( $match ) { $match = 0 ; print "========\n"; print $found; $found = (); } } }
and the test.txt file contains script works as expected
ABCD 122132 12 312 EFGH FRED ABCD sadasd asd das EFGH FRED ABCD asdasd d as EFGH
but when test.txt contains the text below it fails
ABCD 122132 12 312 EFGH ABCD sadasd asd das EFGH ABCD asdasd d as EFGH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Range operator question
by ikegami (Patriarch) on Jul 08, 2010 at 05:18 UTC | |
|
Re: Perl Range operator question
by jwkrahn (Abbot) on Jul 08, 2010 at 05:08 UTC | |
by jhuijsing (Acolyte) on Jul 09, 2010 at 00:08 UTC | |
|
Re: Perl Range operator question
by afoken (Chancellor) on Jul 08, 2010 at 04:56 UTC |