This is a little experimentation on the exercises in the "Learning Perl" book, this what I tried:
#! /usr/perl use warnings; print "Enter a string"; $string = <STDIN>; print "Enter value"; chomp($num = <STDIN>); $result = $string x "$num"; print "The result is :\n $result"; if ($result >= "100"){ print "Too big, bye"; } else { }
$result doesn't want listen to my "if" control structure :( so it goes 100+.
The goal was to have the script detect if the output would be more than 100. And then display a message
Help please ?
In reply to result is not listening to if by prospect
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |