tracks/perl6/exercises/wordy/Example.pm in trackler-2.0.8.28 vs tracks/perl6/exercises/wordy/Example.pm in trackler-2.0.8.29
- old
+ new
@@ -1,16 +1,16 @@
-sub answer($q is copy) is export {
+unit module Wordy:ver<1>;
- given $q {
- s:s:g/^What is|\?$//;
- s:g/plus/+/;
- s:g/minus/-/;
-
- loop {
- last unless s:s/(.*) multiplied by/($0)*/
- or s:s,(.*) divided by,($0)/,;
- }
+sub answer ($q is copy) is export {
+ given $q {
+ s:s:g/^What is|\?$//;
+ s:g/plus/+/;
+ s:g/minus/−/;
+ loop {
+ last unless
+ s:s/(.*) multiplied by/($0)×/
+ or s:s/(.*) divided by/($0)÷/;
}
-
- use MONKEY-SEE-NO-EVAL;
- return EVAL $q;
+ }
+ use MONKEY-SEE-NO-EVAL;
+ EVAL $q or fail;
}