http://qs1969.pair.com?node_id=495544

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

I have file that is one long line. Pattern looks like: somecharSTARTfvENDsomecharSTARTsvENDsomecharSTARTtvENDsomechar I would like to extract all values between START END so my @Result should be @Result= qw(fv sv tv) My sub is extracting only first and last finding :(
sub getInfoFromLongLine { #Openning file for reading open(IFH,"$InputFile") || die "Can't open file: $InputFile\n"; while($line=<IFH>) { if ($line=~/.*START(.*?)END/) { push(@Result,$1); } if ($line=~/.*?START(.*?)END/) { push(@Result,$1); } } return @Result; }
Thanks in advance Gasho