I'm writing a perl script that combine a multiple lines from file into a full sentence. After that, search certain criteria from a sentence. How I can grab this information?
For example, the file contain below text:
I want Perl to combine all lines into a sentence. Script will only read line after 'BUY' and before '.' . After that compare with if-else statement. If match it would return:
Price = RM4.00
Anywhere I only now how to read from file but fail to combine lines into sentence.
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
while( $line = <FILE> )
Can anyone please advise?