This code demonstrates how to work with hex numbers in Perl. #hexadecimal-numbers #perl
my $hex; my $num; $num = hex(pop @ARGV); while(<>) { next if !/^0x/; $hex = unpack("H*", pack("N", $num)); print "0x" . $hex . " " . $_; $num += 4; }