Hi, I'am trying to convert the variable $num into its reverse byte order and print it out. This is what I have done so far:
my $num=0x5514ddb7;
my $s=pack('I!',$num);
print "$s\n";
He prints it out as some non-printable characters and in a hex editor it looks right, but how can I get it readable on the console?
Already tried
print sprintf("%#x\n",$s);
but he complains about an non-numeric argument, so I think pack returns a string. Any ideas how can I print out `0xb7dd1455 on the console, based on $num?