http://www.perlmonks.org?node_id=1012202


in reply to Re^2: I need Hex conversion, not!
in thread I need Hex conversion, not!

use strict; use warnings; sub hexnum { package HexNum; use base 'Math::BigInt'; use overload q[""] => 'as_hex_without_0x'; __PACKAGE__->new(@_); } sub HexNum::as_hex_without_0x { substr($_[0]->as_hex, 2); } my $var = hexnum 0x2F; $var += 3; $var += hexnum 0x02; print "$var\n";
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'