Bit::Vector::String - Generic string import/export for Bit::Vector
| Use Case | Command | Description |
|---|---|---|
| Export vector as octal string | $vector->to_Oct() | Returns octal string (no prefix) |
| Import octal string into vector | $vector->from_Oct($string) | Reads octal string (no prefix) |
| Create new vector from octal string | Bit::Vector->new_Oct($bits,$string) | Constructor + initialize from octal |
| Export in any format | $vector->String_Export($type) | Returns string with identifying prefix |
| Import string with autoโdetect format | $vector->String_Import($string) | Reads string, returns format number |
| Create new vector with autoโdetect format | Bit::Vector->new_String($bits,$string) | Constructor + import, autoโsizes if $bits is undef |
use Bit::Vector::String;
to_Oct
$string = $vector->to_Oct();
from_Oct
$vector->from_Oct($string);
new_Oct
$vector = Bit::Vector->new_Oct($bits,$string);
String_Export
$string = $vector->String_Export($type);
String_Import
$type = $vector->String_Import($string);
new_String
$vector = Bit::Vector->new_String($bits,$string);
($vector,$type) = Bit::Vector->new_String($bits,$string);
$string = $vector->to_Oct();to_Bin().0o). Add it manually if needed: $string = '0o' . $vector->to_Oct();$vector->from_Oct($string);from_Bin().0o allowed.$vector = Bit::Vector->new_Oct($bits,$string);new() then from_Oct().$bits is undef, automatically allocates 3 * length($string) bits.$string = $vector->String_Export($type);$type:1 | b | bin โ binary (0b prefix)2 | o | oct โ octal (0o prefix)3 | d | dec โ decimal (no prefix, sign is prefix)4 | h | hex | x โ hexadecimal (0x prefix)5 | e | enum โ enumeration ({...} wrapper)6 | p | pack โ packed binary (:size:data)$type is omitted/undef/false, defaults to hexadecimal.$type = $vector->String_Import($string);0b for binary).$vector = Bit::Vector->new_String($bits,$string);($vector,$type) = Bit::Vector->new_String($bits,$string);$bits is undef, automatically calculates required bits based on format:binary โ length($string)octal โ 3 * length($string)decimal โ int(length($string) * log(10)/log(2) + 1)hexadecimal โ 4 * length($string)enumeration โ max value + 1packed binary โ extracted from :size: prefixBit::Vector(3), Bit::Vector::Overload(3).
This man page documents Bit::Vector::String version 7.4.
Steffen Beyer mailto:<STBEY AT cpan.org> http://www.engelschall.com/u/sb/download/
Copyright (c) 2004 - 2013 by Steffen Beyer. All rights reserved.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".
The C library at the core of this Perl module can additionally be redistributed and/or modified under the terms of the "GNU Library General Public License".
Please refer to the files Artistic.txt, GNU_GPL.txt and GNU_LGPL.txt in this distribution for details!
This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the "GNU General Public License" for more details.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 21:48 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)