Ultimately my goal is to convert a hexdump of data to the correct floating point value. I have set up my shell script to isolate the individual hex values I need to look at and arrange them in the correct order for a little Endian float conversion.
To simplify everything, I'll bypass the code I have managed to get working, and I'll start with:
rawHex=0x41000000
echo $(perl -e 'print unpack "f", pack "L", $ENV{rawHex}')
When I execute this code, the result is 0. However if I were to execute the code without attempting to pull the value of the shell variable:
echo $(perl -e 'print unpack "f", pack "L", 0x41000000')
The result is 8, which is what I am expecting.
I'd appreciate any help on how I can update my Perl expression to properly interpret the value of the shell variable. Thanks.