in reply to When One Line Becomes Three

Just split the results to process them in another loop:

while (<fp>) { s/\(/\n\(\n/g; s/\)/\n\)\n/g; #do stuff to current line print ">$_<\n" foreach split /\n/; # OR foreach my $t ( split /\n/ ) { print ">$t<\n"; } }


-mk

Replies are listed 'Best First'.
Re: Re: When One Line Becomes Three
by JojoLinkyBob (Scribe) on Jun 14, 2001 at 22:39 UTC
    Thanks, the response were helpful. After farting around with it some more, I came up with
    my @lines = split (/\n/); for my $line(@lines) {
    which is pretty much your implementation. Thanks! Desert coder