Let me rephrase that question:
Is there a way I can store large integers (> 2**32) as
character strings in radix 10 or radix 16 and covert
these strings to and from bitvectors from which I can
insert and extract individual bits?
I think bitvector is the name of the module. I did a
search on CPAN and looked thru my perldoc but could
not find it. What is the name of feature for storing
large boolean arrays?
Thanks,
Siegfried
--- WC -Sx- Jones <[EMAIL PROTECTED]> wrote:
> Richard Heintze wrote:
>
> > What if I need more than 32 elements in my bit
> array?
> > I suppose I could use the first hidden field for
> the
> > first 32 elements of my array and the next 32
> elements
> > are stored in the next hidden field. Uggghhh... Is
> > there an easier way?
>
> You must not read the regular beginners list?
>
> Lucky you :) Store it in as many 32 bit numbers
> as required and use pack/unpack -
>
> #! /usr/bin/perl
> use strict;
> use warnings;
>
> my $count;
> my $index;
> my $str;
>
> while (++$index) {
> $count = $index;
>
> while(1) {
> (++$count) ? $count += $count--
> : $count += $count++;
>
> $str = unpack("B32", pack("N", $count));
> print "$count \tis binary $str\n";
> last if $count > 60_000;
> sleep 1;
> }
>
> exit if $index > 255;
> }
>
> __END__
> -Sx-
>
> PS - Incase you missed the joke -
> the ONLY relevant part of this
> answer is -
>
> $str = unpack("B32", pack("N", $count));
>
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> <http://learn.perl.org/>
> <http://learn.perl.org/first-response>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>