use Devel::Peek; my $hex = sprintf( "0x%02x%02x%02x40", 60,179,113 ); print "\n\$hex as returned from sprintf:\n"; Dump($hex); my $num = hex $hex; print "\$hex hex()ed:\n"; Dump($num); $hex += 0x1; print "\$hex augmented with 0x01:\n"; print $hex,"\n"; __END__ $hex as returned from sprintf: SV = PV(0x8c90c20) at 0x8c90750 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8cb34f0 "0x3cb37140"\0 CUR = 10 LEN = 12 $hex hex()ed: SV = IV(0x8cabcac) at 0x8c9078c REFCNT = 1 FLAGS = (PADBUSY,PADMY,IOK,pIOK) IV = 1018392896 $hex augmented with 0x01: 1