Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
[EMAIL PROTECTED] wrote:
I have a file which contains a number of instances of the word
"FINAL". I need to truncate all the instances of this word and
create an output string of the rest of the words in the same line
in the file. Rest all lines not containing the word are to be
ignored.
<snip>
it still leaves spaces in all the occurences of the word.
If I understand your problem correctly then this should work:
while ( <OUT1> ) {
chomp;
s/\s*FINAL|FINAL\s*//g and $sec_seq1 .= $_;
}
}
I fail to see how "FINAL\s*" ever can match if "\s*FINAL" doesn't match.
Oops, I should have used + instead of * I guess. :-)
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>