How can I print characters with their octal representations? Note that these characters might be special characters (escapes, backscapes, arrow keys, etc.).
For example, I would like a function 'printoctal', such that:
my $char = 'P';
printoctal $char;
And I would like that to print 120
.