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 '
In reply to Re^3: Change the behavior of Perl's IRS
by BrowserUk
in thread Change the behavior of Perl's IRS
by LighthouseJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |