in reply to Re^2: Change the behavior of Perl's IRS
in thread Change the behavior of Perl's IRS

It's not complicated, just discard the first separator:

#! perl use strict; { $/ = "myrecordsep\n"; scalar <DATA>; ##discard the first; while (<DATA>) { chomp; print "'$_'\n"; } } __DATA__ myrecordsep field1=item1 field2=item2 myrecordsep field1=item1 field2=item2 myrecordsep field1=item1 field2=item2 myrecordsep field1=item1 field2=item2

Produces:

C:\test>junk2 'field1=item1 field2=item2 ' 'field1=item1 field2=item2 ' 'field1=item1 field2=item2 ' 'field1=item1 field2=item2 '

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."