in reply to vec and array parameters
Well, there is some implication in the documentation because it does say: vec EXPR, OFFSET, BITS However, when in doubt, look at the prototype for the routine:
perl -le 'print prototype "CORE::vec"'
And you'll see that three arguments are required and that they are all coerced into a scalar context (assuming you understand perl's idea of prototypes :-)
As for a work-around, that's easy:
:-)$vec = ''; my ($offset,$bits) = (0, 4); vec($vec, $offset, $bits) = 1; $bits = unpack("b*", $vec); print "$bits\n";
|
|---|