Bit::V...inimal(3pm)
π Bit::Vector::Minimal β okay bestie, let's talk bits π
So this is Bit::Vector::Minimal, straight out of the User Contributed Perl Documentation corner of the Perl world. It's a whole little module and it is, no cap, the object-oriented wrapper around vec() that your Perl brain has been waiting for. π¦
β¨ NAME β¨
Bit::Vector::Minimal β an object-oriented wrapper around vec(). That's the whole vibe. π
πΈ SYNOPSIS πΈ
Here's you, living your best life:
use Bit::Vector::Minimal;
my $vec = Bit::Vector->new(size => 8, width => 1, endianness => "little");
# These are the defaults
$vec->set(1); # $vec's internal vector now looks like "00000010"
$vec->get(3); # 0
Yes bestie, those are the defaults, I said what I said. β¨
π DESCRIPTION π
This is the much simplified, lightweight version of Bit::Vector β think of it like Bit::Vector's chill younger sibling who still gets the job done. It wraps Perl's vec function (which is, let's be honest, sometimes confusing π) inside an object-oriented abstraction, so you get to touch bits without crying. Iconic behavior, honestly. π
π METHODS π
π§ new
Makes you a brand new bit vector. By default you get a one-byte vector with 8 one-bit "slots", and bit zero lives on the right of the bit pattern. Cozy.
Wanna change things up? Pass some parameters to the constructor, queen:
sizeβ this alters the size in bits of the vector. πwidthβ this alters the width of the slots. πendiannessβ this controls whether the zeroth place sits on the right or the left of the bit vector. π
β οΈ Heads up bestie: the module will die ifwidthis not an integer divisor ofsize. It is not playing. Do the math first. π
π set(POS[, VALUE])
Sets the bit or slot at position POS to value VALUE. If you don't hand over a VALUE, it goes "all bits on" instead. It's giving generous. π
π get(POS)
Returns the bit or slot sitting pretty at position POS. Just the one. No extras. Periodt. β¨
π₯ display
Displays the vector. It's for debugging purposes, so like, don't make it your whole UI aesthetic or anything. π
π AUTHOR π
- Current maintainer: Tony Bowden
- Original author: Simon Cozens
Two legends, one module. We stan. π«Ά
π BUGS and QUERIES π
Got beef? Got questions? Got a bug that's living rent-free in your head? Direct all correspondence regarding this module to:
bug-Bit-Vector-Minimal@rt.cpan.org
They're waiting. Be nice. πΈ
π SEE ALSO π
Bit::Vectorβ the big one, the original, the blueprint. Go look if you need more than the minimal moment. π
π COPYRIGHT AND LICENSE π
Copyright 2003, 2004 by Kasei.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, legally speaking. βοΈβ¨
perl v5.36.0 Β· 2022-11-20 Β· Bit::V...inimal(3pm)
Okay bestie that's the whole page, every last bit (literally π¦) β this was documented way back on 2022-11-20, running under perl v5.36.0, filed under that adorable truncated name Bit::V...inimal(3pm). Go forth and vec responsibly. Mwah. π
ππ
π¦ where this page comes from
- debian bookworm: libbit-vector-minimal-perl 1.3-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbit-vector-minimal-perl 1.3-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbit-vector-minimal-perl 1.3-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbit-vector-minimal-perl 1.3-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbit-vector-minimal-perl 1.3-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms