jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
From the result I realized that I do not fully understand vec and maybe also pack/unpack#! /usr/bin/perl use strict ; use warnings ; my $bitstring = "" ; my $offset = 0 ; for my $i (0..20) { vec( $bitstring, $offset++, 4 ) = $i ; } my $bits = unpack("A4*", $bitstring); print "$bits\n" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HowTo unpack a vec (bitstring)
by Joost (Canon) on Jun 19, 2006 at 10:00 UTC | |
|
Re: HowTo unpack a vec (bitstring)
by Joost (Canon) on Jun 19, 2006 at 09:13 UTC | |
by jeanluca (Deacon) on Jun 19, 2006 at 09:28 UTC | |
by Joost (Canon) on Jun 19, 2006 at 09:40 UTC | |
by jeanluca (Deacon) on Jun 19, 2006 at 09:44 UTC | |
by Joost (Canon) on Jun 19, 2006 at 09:50 UTC |