aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-10-22 11:23:22 +0100
committerGitHub <noreply@github.com>2019-10-22 11:23:22 +0100
commitf3a8abb2fac24653e9b8f477343337cc9aac97b3 (patch)
treeb61935f5a5be708f61ae6c61f4195d57bb08bc89
parentd74cf521fe826fb061df4c2b3b4ef200b1498eb5 (diff)
parent20ca0710d16f90dae678786c2f1a7055f8710cfb (diff)
downloadperlweeklychallenge-club-f3a8abb2fac24653e9b8f477343337cc9aac97b3.tar.gz
perlweeklychallenge-club-f3a8abb2fac24653e9b8f477343337cc9aac97b3.tar.bz2
perlweeklychallenge-club-f3a8abb2fac24653e9b8f477343337cc9aac97b3.zip
Merge pull request #826 from Doomtrain14/master
Updated solution/comments ch#31-1
-rw-r--r--challenge-031/yet-ebreo/perl5/ch-2.pl22
1 files changed, 18 insertions, 4 deletions
diff --git a/challenge-031/yet-ebreo/perl5/ch-2.pl b/challenge-031/yet-ebreo/perl5/ch-2.pl
index 92895a9f46..c0909137e7 100644
--- a/challenge-031/yet-ebreo/perl5/ch-2.pl
+++ b/challenge-031/yet-ebreo/perl5/ch-2.pl
@@ -25,10 +25,24 @@ $$varname = 0|100*rand;
# Should update the value of the variable being referred to
# the code below will print the random generated value assigned
-# to the reference *IF* the user inputs "dynamic_var" as
-# the variable name, otherwise the variable will be empty
-
-say $dynamic_var;
+# to the reference.
+say "You created a variable named \"$ARGV[0]\" and has a value of ${$ARGV[0]}\n";
+say "This line prints the value of a variable named dynamic_var: [$dynamic_var]";
+say "If the user inputs the same variable name, dynamic_var variable will have value otherwise it will be empty\n";
#NOTE: because of the nature of the task,
# use strict was removed.
+
+=begin
+perl .\ch-2.pl dynamic_var
+You created a variable named "dynamic_var" and has a value of 78
+
+This line prints the value of a variable named dynamic_var: [78]
+If the user inputs the same variable name, dynamic_var variable will have value otherwise it will be empty
+
+perl .\ch-2.pl my_var
+You created a variable named "my_var" and has a value of 38
+
+This line prints the value of a variable named dynamic_var: []
+If the user inputs the same variable name, dynamic_var variable will have value otherwise it will be empty
+=cut \ No newline at end of file