From 627399bcaee79501fa2e02c9285b51364957adf9 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Fri, 18 Dec 2015 10:07:35 +0100 Subject: Port to Regexp::Common --- Aufgabe6/RPN/README | 1 + Aufgabe6/RPN/lib/RPN.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'Aufgabe6') 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); } -- cgit v1.2.3-70-g09d2