aboutsummaryrefslogtreecommitdiff
path: root/challenge-031
diff options
context:
space:
mode:
authorRuben Westerberg <drclaw@mac.com>2019-10-27 08:39:33 +1000
committerRuben Westerberg <drclaw@mac.com>2019-10-27 08:39:33 +1000
commitb90c723afa938b99f2af9aa5254745ea8efcef3b (patch)
treed77b41dbe768361dc86c07de7a86920963e73b65 /challenge-031
parented9a2f7fe33721940df37fd8b4b9e625558030eb (diff)
downloadperlweeklychallenge-club-b90c723afa938b99f2af9aa5254745ea8efcef3b.tar.gz
perlweeklychallenge-club-b90c723afa938b99f2af9aa5254745ea8efcef3b.tar.bz2
perlweeklychallenge-club-b90c723afa938b99f2af9aa5254745ea8efcef3b.zip
Fixed default variable name error
Diffstat (limited to 'challenge-031')
-rw-r--r--challenge-031/ruben-westerberg/README5
-rwxr-xr-xchallenge-031/ruben-westerberg/perl6/ch-2.p62
2 files changed, 5 insertions, 2 deletions
diff --git a/challenge-031/ruben-westerberg/README b/challenge-031/ruben-westerberg/README
index a14127bd20..2ca4621c32 100644
--- a/challenge-031/ruben-westerberg/README
+++ b/challenge-031/ruben-westerberg/README
@@ -3,7 +3,10 @@ Solution by Ruben Westerberg
ch-1.pl and ch-1.p6
===
Run the program with two command line arguments. First is the numerator, second is the denominator. Output will print successful result unless a divide by zero is detected.
+If no arguments are provided numerator is set to 1 and denominator is set to 0
ch-2.pl and ch-2.p6
===
-
+Run the program with two arguments. The first is the name of ther variable to create and the second is the value to assign.
+Output is the name and value of the dynamicaly named variable
+If no arguments are given a random name and value are created;
diff --git a/challenge-031/ruben-westerberg/perl6/ch-2.p6 b/challenge-031/ruben-westerberg/perl6/ch-2.p6
index 61bfdceee6..f4ea55d641 100755
--- a/challenge-031/ruben-westerberg/perl6/ch-2.p6
+++ b/challenge-031/ruben-westerberg/perl6/ch-2.p6
@@ -1,6 +1,6 @@
#!/usr/bin/env perl6
use MONKEY-SEE-NO-EVAL;
-my $name=@*ARGS[0]//"\$var"~1000.Int;
+my $name=@*ARGS[0]//"var"~1000.rand.Int;
my $value=@*ARGS[1]//1.rand;
{
put "Using Module/eval";