diff --git a/rpn b/rpn index 70606be..5dafafb 100755 --- a/rpn +++ b/rpn @@ -41,6 +41,12 @@ while (<>) { } elsif (m{^ld$}) { my $x = pop @stack; push @stack, log($x) / log(2); + } elsif (m{^0x[0-9a-fA-F]+$}) { + no warnings 'portable'; + push @stack, hex($_); + } elsif (m{^0[0-7]+$}) { + no warnings 'portable'; + push @stack, oct($_); } else { push @stack, $_; }