rje has asked for the wisdom of the Perl Monks concerning the following question:
--- Code snippet begins ---\x0a Record stuff goes here more of the same record here yet more record data. \x0a Next record starts here and continues on for a while and finally terminates. \x0a You get the idea. Please note that \x0a is a one-character ASCII code, not the string of characters '\x0a'. \x0a I probably can't rely on indents for record boundary checking, either.
I suspect that my $/ = /\x0a/ and $/ = '\x0a' fails because \x0a isn't text, right? Must I do an unpack(), or am I overlooking something?use strict; # I'm not a total neanderthal $/ = /\x0a/; # also tried '\x0a' open IN, shift; my @records = <IN>; close IN; # number of records == 1 (globbed!)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting on unprintables
by ChrisS (Monk) on Aug 13, 2003 at 16:54 UTC | |
|
Re: Splitting on unprintables
by hardburn (Abbot) on Aug 13, 2003 at 17:00 UTC | |
by sauoq (Abbot) on Aug 13, 2003 at 21:27 UTC |