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