# perldoc > Bit::Vector::Overload

---
type: CommandReference
command: Bit::Vector::Overload
mode: perldoc
section: 
source: perldoc
---

## Quick Reference
- `"$vector"` — convert to string per configuration
- `if ($vector)` — boolean: true if any bit is set
- `~$vector` — one's complement (bitwise NOT)
- `$v1 | $v2` — union (bitwise OR)
- `$v1 << $bits` — shift left
- `$v1 eq $v2` — equality test (unsigned)
- `abs($vector)` — norm (number of set bits) or absolute value
- `$v1 .= $v2` — concatenate two vectors

## Name
Overloaded operator add‑on for [Bit::Vector](http://localhost/phpMan.php/perldoc/Bit%3A%3AVector/markdown)

## Synopsis
perl
use Bit::Vector::Overload;      # instead of "use Bit::Vector;"
my $vec = Bit::Vector->new(32);
$vec->Configuration("input=bit,ops=set,out=hex");
## Options
The `Configuration()` method controls scalar input interpretation, operator semantics, and string output format. Call with a string containing `aspect=value` pairs (case‑insensitive, separated by commas or semicolons).

**Scalar input** (default: `bit`)
- `bit`, `index`, `indice` — numeric bit indices
- `hex` — hexadecimal string (quoted)
- `bin` — binary string (quoted, only `0`/`1`)
- `dec` — decimal string or number (use quotes for large values)
- `enum` — comma‑separated index/ranges (`"2,3,5,7-13"`)

**Operator semantics** (default: `set`)
- `set` — `+` union, `-` difference, `*` intersection, `<`/`<=`/`>`/`>=` true subset/superset
- `arithmetic` — `+` addition, `-` subtraction, `*` multiplication, `<`/`<=`/`>`/`>=` signed numeric compare

**String output** (default: `hex`)
- `hex` — hexadecimal
- `bin` — binary
- `dec` — decimal (slow for large vectors)
- `enum` — enumeration style (`0,3,5-7`)

Returns previous configuration string when called without arguments.

## Examples
perl
# Set operations (default semantics)
use Bit::Vector::Overload;
my $a = Bit::Vector->new_Dec(64, "42");
my $b = Bit::Vector->new_Dec(64, "13");
my $union = $a | $b;          # bitwise OR
print "union: $union\n";      # hex output

# Arithmetic with decimal strings
Bit::Vector->Configuration("ops=arithmetic,in=dec,out=dec");
my $sum = $a + $b;            # addition
print "sum: $sum\n";
## See Also
- [Bit::Vector](http://localhost/phpMan.php/perldoc/Bit%3A%3AVector/markdown)  
- [Bit::Vector::String](http://localhost/phpMan.php/man/String/3/markdown)