in reply to Re: result is not listening to if
in thread result is not listening to if
Hello! I just tought I would try to add a limit on the string output to an exercise in the Perl book I'm reading, The excercise was "8 Write a program that prompts for and reads a string and a number (on separate lines of input) and prints out the string the number of times indicated by the num- ber on separate lines. (Hint: use the x operator.) If the user enters “fred” and “3”, the output should be three lines, each saying “fred”. If the user enters “fred” and “299792,” there may be a lot of output." I though that if you put double quoutes around a variable value in Perl, Perl would know for example that "20" is a number. And that if you put variable value between single quotes like this "my $number = '20'. Perl would take it as a literal string. I'll check out those links thank you. Regards
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: result is not listening to if
by hippo (Archbishop) on Jul 14, 2017 at 14:09 UTC | |
by prospect (Acolyte) on Jul 14, 2017 at 14:21 UTC | |
by hippo (Archbishop) on Jul 14, 2017 at 14:37 UTC | |
|
Re^3: result is not listening to if
by thanos1983 (Parson) on Jul 14, 2017 at 14:36 UTC |