use strict; use warnings; my $bar = 0x100; print foo(sprintf("%x",$bar)); sub foo { return shift() . "abc"; }