in reply to Reading binary file in perl having records of different length
I see a brother has pointed out the issue with == alignment. Another point to make is that reading the file as a whole can indeed simplify parsing. Consider:
$data = do{ undef $/; <$fh> }; while ($data =~ m/==/) { ($rec, $data) = unpack("n/A A*", $'); process($rec); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Reading binary file in perl having records of different length
by jaypal (Beadle) on Jun 17, 2014 at 22:35 UTC | |
by johngg (Canon) on Jun 18, 2014 at 10:18 UTC | |
by sundialsvc4 (Abbot) on Jun 18, 2014 at 21:12 UTC | |
by jaypal (Beadle) on Jun 19, 2014 at 01:32 UTC |
In Section
Seekers of Perl Wisdom