in reply to How to deal with long line
If the file is of modest size then read eveything into a string and:
Update: Change to read from a "file"my $str = <DATA>; my @strs = $str =~ /START(.*?)END/g; print join "\n", @strs; __DATA__ somecharSTARTfvENDsomecharSTARTsvENDsomecharSTARTtvENDsomechar
Monarch has suggested to me that this is likely to get pretty slow with HUGE files, and I agree. For very large files I'd suggest using this technique.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to deal with long line
by gasho (Beadle) on Sep 28, 2005 at 13:09 UTC |