in reply to How to deal with long line
Here's one way that reads in the string a little bit at a time, which is good if your data is very large. Mostly untested, but works for your data:
use warnings; use strict; my @wanted_substrings; { local $/ = 'END'; while(my $string = <DATA>) { push @wanted_substrings, ($string =~ /START(.*)END/); } } print "@wanted_substrings"; __DATA__ somecharSTARTfvENDsomecharSTARTsvENDsomecharSTARTtvENDsomechar
|
---|
In Section
Seekers of Perl Wisdom