From 9d590f521cbafdb6870a55844b5f4085b9cbdc34 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Thu, 29 Nov 2012 17:09:20 +0100 Subject: [PATCH] hex and oct numbers --- rpn | 6 ++++++ 1 file changed, 6 insertions(+) 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, $_; }