in reply to passing hex argument as string
One way is to use sprintf:
use strict; use warnings; my $bar = 0x100; print foo(sprintf("%x",$bar)); sub foo { return shift() . "abc"; } [download]
You can check out perlfunc for details of this function.