in reply to Change the behavior of Perl's IRS

If you can afford to slurp the file into memory/into a scalar, split is very handy. Just one additional statement as corrective measure does not hurt clarity.
$_ = 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 ...';
(update: lookahead)