I have a question that's been bugging me that I'd like to offer to the more experienced Monks out there.
I'm interested in changing Perl's behavior with the input record seperator, specifically, I want Perl to handle it like it's at the beginning of a segment.
Say I have input text that looks like this:
myrecordsep
field1=item1
field2=item2
...
myrecordsep
field1=item9
field2=item10
...
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?
"The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why." -- `man perl`