in reply to passing hex argument as string
The hex number exists only on the right hand side of line 1; the value stored in $num is 0...0100000000, popularly known as 256.
If f2 doesn't do any calculations with the argument, only print it out, you might be able to pass in the number as a hex string:
f2( sprintf "0x%0x", $num );
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|