in reply to Change the behavior of Perl's IRS
(update: lookahead)$_ = q{stuff before myrecordsep field1=item1 field2=item2 ... myrecordsep field1=item9 field2=item10 ... }; @chunks = split /myrecordsep\n/; # /(?=myrecordsep\n)/ in case you want to keep the sep in the chunk Dump @chunks; shift @chunks; # discard the first if not needed __END__ $VAR1 = 'stuff before '; $VAR2 = 'field1=item1 field2=item2 ... '; $VAR3 = 'field1=item9 field2=item10 ...';
|
|---|