in reply to Re^2: Perl Unpack Cobol Binary File and Fields
in thread Perl Unpack Cobol Binary File and Fields
I would guess that your PIC(5) means four or five bytes, at least that matches up somewhat well with your data. If we assume the first four bytes, then unpack 'N', substr $str, 0,4 gives 431:
#!perl use strict; use warnings; my $str = "\0\0\1\o{257}\a\o{344}\0\3\0\0\0s\06\o{002}\o{267}"; my $data1 = unpack "N", substr($str,0,4); print $data1;
I don't know how to get from the 431 I get to the 425 you get, but maybe the other numbers give a better clue here?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl Unpack Cobol Binary File and Fields
by dbarkho14 (Novice) on May 04, 2020 at 20:02 UTC | |
by Corion (Patriarch) on May 04, 2020 at 20:15 UTC | |
by dbarkho14 (Novice) on May 04, 2020 at 21:08 UTC |