kjoy10970 has asked for the wisdom of the Perl Monks concerning the following question:
With the below code , it only unpacks the first 4 values and the rest of the values are coming null. I need to get all the values, what am I doing wrong here? Please help me. Code is down here
use Data::Dumper; my $counter = 'a0000000'; my @x= unpack('(B3)(B3)(B2)(B)(B)(B)(B2)(B3)BBBBB(B11)', pack('H*', $c +ounter)); print Dumper(\@x);
Output:
$VAR1 = [ '101', '000', '00', '0', '', '', '', '', '', '', '', '', '', '' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to unpack a hex string
by Eily (Monsignor) on May 17, 2017 at 08:18 UTC | |
by BrowserUk (Patriarch) on May 17, 2017 at 09:44 UTC | |
by Eily (Monsignor) on May 17, 2017 at 09:57 UTC | |
|
Re: Unable to unpack a hex string
by tybalt89 (Monsignor) on May 17, 2017 at 06:24 UTC | |
|
Re: Unable to unpack a hex string
by AnomalousMonk (Archbishop) on May 17, 2017 at 14:03 UTC | |
by kjoy10970 (Initiate) on May 17, 2017 at 17:31 UTC |