in reply to passing hex argument as string

The simple answer is to create the string with sprintf "%x". There's more information about controlling the hexadecimal formating in the Categorized Q&A How do I convert from decimal to hexidecimal?.

(updated to correct my hexi->hexa but leave the Q link wrong)

That's the end of the practical answer. Flight of fancy follows...

Unfortunately, once you create the string '100' from 0x100 (=256), you need to be sure you are only using it as a string, not as a number, so that nothing interprets it as the number 10*10. But never fear, perl has the tools to let you create a variable that has distinct string and numeric values:
$ perl -wlne'eval;print$@if$@ # interactive perl' use Scalar::Util 'dualvar'; $x = dualvar(256, sprintf "%x", 256); print $x; 100 # correct hexadecimal string print 0+$x; 256 # correct numeric value
But there is a problem with that. If some well-meaning code tries to change our value, we lose either the string or numeric value:
$x .= "foo"; print 0+$x; Argument "100foo" isn't numeric in addition (+) at (eval 9) line 1, <> + line 8. 100 print $x; 100foo $x = dualvar(256, '100'); $x += 3; print 0+$x; 259 print $x 259
Kind of makes you want some way to turn on a readonly flag for a scalar you've set up this way.
require 5.008; Internals::SvREADONLY($x, 1)