diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-12-18 10:07:35 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-12-18 10:07:35 +0100 |
| commit | 627399bcaee79501fa2e02c9285b51364957adf9 (patch) | |
| tree | 6bfe82034c1790c18e10a339e8951e94a779e53a | |
| parent | 6e588e7e9d9ed4da30c0240b016b33d577b9ea50 (diff) | |
| download | Skriptsprachen-627399bcaee79501fa2e02c9285b51364957adf9.tar.gz Skriptsprachen-627399bcaee79501fa2e02c9285b51364957adf9.zip | |
Port to Regexp::Common
| -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); } |
