in reply to PERL Binary Data Handling
First of all, I want to congratulate you, as a newbie, for utilizing code tags :).
- While you may want 33 bits worth of data, when you write it, it will be 40-bits worth of data. You would be best served by explicitly defining all 40 bits in your pack operation
- pack takes string parameters. You're reading in a binary value, and passing that as the argument to pack. To do what you want, you should my $str = unpack ("b32", $buff); and then use $str as the second arg
- You probably want to use syswrite to do your output, rather than print
fnord
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: PERL Binary Data Handling
by ashes3d (Initiate) on Oct 05, 2012 at 23:23 UTC | |
by kcott (Archbishop) on Oct 06, 2012 at 07:36 UTC | |
by ashes3d (Initiate) on Oct 06, 2012 at 09:03 UTC |
In Section
Seekers of Perl Wisdom