shaludr has asked for the wisdom of the Perl Monks concerning the following question:
I want the result in new lines. can someone help with that ? but when i print it with new line i get an error Modification of a read-only value attempted at - line 5, <FILE> line 1. Any ideas how to fix this ?open (FILE,"abc345.txt") or die $!; while (<FILE>){ $_ = /((^Query = .*)|(^\>.*)|(Length = .*))/i; print $1 "\n"; print $2 "\n"; print $3 "\n"; print $4 "\n"; } close (FILE) ;
can anybody tell me how to get just the first 4 matches for all the regex?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: add new lines to output.
by kennethk (Abbot) on May 06, 2010 at 22:38 UTC | |
|
Re: add new lines to output.
by elTriberium (Friar) on May 06, 2010 at 23:56 UTC | |
by shaludr (Initiate) on May 07, 2010 at 03:01 UTC | |
by Marshall (Canon) on May 07, 2010 at 03:50 UTC | |
by rovf (Priest) on May 07, 2010 at 07:14 UTC | |
|
Re: add new lines to output.
by pavunkumar (Scribe) on May 07, 2010 at 08:33 UTC | |
by Marshall (Canon) on May 07, 2010 at 09:23 UTC | |
|