Copyright © tutorialspoint.com
hex EXPR
hex
Interprets EXPR as a hexadecimal string and returns the value, or converts $_ if EXPR is omitted.
In scalar context - Numeric value equivalent to hexa.
Try out following example:
#!/usr/bin/perl print hex '0xAf'; # prints '175' print "\n"; print hex 'aF'; # same