llancet has asked for the wisdom of the Perl Monks concerning the following question:
In my opinion, $value should be string "255". Actually,use strict; # generate a 64-bit all-1 mask my $mask; for (my $i=0; $i<64; $i++) { vec($mask,$i,1)=1; } # get a byte of value from 17 my $value = vec($mask,16,8); print "$value\n";
give me that, but with start index other than 0, it always give me "0". So how does it work?vec($mask,0,8)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how does vec() return?
by almut (Canon) on Sep 25, 2009 at 11:51 UTC | |
by llancet (Friar) on Sep 26, 2009 at 03:05 UTC |