LighthouseJ has asked for the wisdom of the Perl Monks concerning the following question:
Perl expects the input record separator to be at the end of a chunk of text but my data prints it at the beginning. When I set $/ = 'myrecordsep' and read chunks, as expected the first chunk is defined but zero-length, the last chunk isn't read at all and all the chunks in the middle are read fine of course. I have done some ugly corrective measures while using $/, and I've of course read each line of text in and gone "the long way". I haven't lost hope that there's a nice and clean way to use the chunked method (with $/) and without any ugly corrective code. Can anybody think of anything I haven't?myrecordsep field1=item1 field2=item2 ... myrecordsep field1=item9 field2=item10 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Change the behavior of Perl's IRS
by ikegami (Patriarch) on Jul 14, 2007 at 18:56 UTC | |
by LighthouseJ (Sexton) on Jul 14, 2007 at 19:59 UTC | |
by BrowserUk (Patriarch) on Jul 14, 2007 at 20:10 UTC | |
by ikegami (Patriarch) on Jul 15, 2007 at 07:57 UTC | |
by BrowserUk (Patriarch) on Jul 15, 2007 at 08:04 UTC | |
by ikegami (Patriarch) on Jul 16, 2007 at 02:31 UTC | |
|
Re: Change the behavior of Perl's IRS
by FunkyMonk (Bishop) on Jul 14, 2007 at 20:10 UTC | |
|
Re: Change the behavior of Perl's IRS
by daxim (Curate) on Jul 14, 2007 at 20:20 UTC |