in reply to Re: Re^3: IP Header
in thread IP Header
If you unpack("B*", $foo), you will get all the bits (as a string) in the right order. Here is one way to get your final answer, although I'm not sure that eval "0b$_" is the best solution:
($ver, $hlen, $tos, $len) = map { eval "0b$_" } unpack "A4A4A8A16", un +pack("B*", $a);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: B versus b
by Aristotle (Chancellor) on Nov 03, 2002 at 14:36 UTC |