Hi All,

I am new to perl and while going through the chapters of Learning perl, i just came through one excessive, while i was able to complete it, i just came across something that didn't work and i couldn't find any explanation for it. Would be great if i get some help in understanding this behavior.

below is the code

print "the string: ";
$string = <STDIN>;
print "the no.: ";
chomp($number = <STDIN>);
$result = $string x $number;
print "the result is:\n$result";


in the above code when i use
$result = $string x $number;
i get the right result, i.e. strings printed on two lines.

but, when i use
$result = $number x $string;
I don't get any output at all, just wondering why this happens, any help would be highly appreciable.

Regards,
Omps

Reply via email to