diff options
Diffstat (limited to 'Aufgabe6/RPN')
| -rw-r--r-- | Aufgabe6/RPN/README | 1 | ||||
| -rw-r--r-- | Aufgabe6/RPN/lib/RPN.pm | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Aufgabe6/RPN/README b/Aufgabe6/RPN/README index df1a08c..28a66fb 100644 --- a/Aufgabe6/RPN/README +++ b/Aufgabe6/RPN/README @@ -17,6 +17,7 @@ DEPENDENCIES This module requires these other modules and libraries: Math::Trig + Regexp::Common COPYRIGHT AND LICENCE diff --git a/Aufgabe6/RPN/lib/RPN.pm b/Aufgabe6/RPN/lib/RPN.pm index 6e8f5b1..be5915d 100644 --- a/Aufgabe6/RPN/lib/RPN.pm +++ b/Aufgabe6/RPN/lib/RPN.pm @@ -3,7 +3,7 @@ package RPN; use strict; use warnings; use Math::Trig; - +use Regexp::Common; require Exporter; our @ISA = qw(Exporter); @@ -368,7 +368,7 @@ sub rpn { } else { - if ($operand =~ /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/) + if ($operand =~ /^$RE{"num"}{"real"}$/) { push (@stack, $operand); } |
