Gerard has asked for the wisdom of the Perl Monks concerning the following question:
what I was expecting to see was something like:use strict; my $char = "~"; my $temp = vec($char, 0, 8); my @charBits = split(//, unpack("b8", $temp)); print $temp . "\n"; foreach (@charBits){ print $_; }
but instead I got:126 01111110
I am obviously missing something vital.126 10001100
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using vec() and unpack()
by antirice (Priest) on Aug 16, 2003 at 03:17 UTC | |
|
Re: using vec() and unpack()
by jmcnamara (Monsignor) on Aug 16, 2003 at 08:41 UTC | |
|
Re: using vec() and unpack()
by graff (Chancellor) on Aug 16, 2003 at 03:21 UTC | |
by Gerard (Pilgrim) on Aug 16, 2003 at 04:52 UTC |