From 9c83202be700db822481d04e23de619aa9113815 Mon Sep 17 00:00:00 2001 From: andrezgz Date: Thu, 18 Jul 2019 08:02:11 -0300 Subject: challenge-010 andrezgz minor fix for ch-1 --- challenge-010/andrezgz/perl5/ch-1.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/challenge-010/andrezgz/perl5/ch-1.pl b/challenge-010/andrezgz/perl5/ch-1.pl index beed25baaf..a1cfa3ca7d 100644 --- a/challenge-010/andrezgz/perl5/ch-1.pl +++ b/challenge-010/andrezgz/perl5/ch-1.pl @@ -44,14 +44,14 @@ exit 0; # Subtractive notation roman number validation sub _is_valid_roman { - return $arg =~ / - ^ # String start - M{0,3} # Matching from 1000 to 3000 - (?:CM|CD|D|D?C{0,3})? # Matching from 100 to 900 - (?:XC|XL|L|L?X{0,3})? # Matching from 10 to 90 - (?:IX|IV|V|V?I{0,3})? # Matching from 1 to 9 - $ # String end - /xi; + return $_[0] =~ / + ^ # String start + M{0,3} # Matching from 1000 to 3000 + (?:CM|CD|D|D?C{0,3})? # Matching from 100 to 900 + (?:XC|XL|L|L?X{0,3})? # Matching from 10 to 90 + (?:IX|IV|V|V?I{0,3})? # Matching from 1 to 9 + $ # String end + /xi; } sub encode_roman { -- cgit