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

Wow, that is cool. Btw, is there a way to ignore 0x prefix without substr, or anything ?

Replies are listed 'Best First'.
Re^3: I need Hex conversion, not!
by tobyink (Canon) on Jan 08, 2013 at 09:33 UTC
    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'