I write like that, but it is error: Use unitialized num1 in additional
for ( 1 .. 5 ) { my $num1 = int(rand(10)); some(); } sub some { print "Enter a number: \n"; #chomp (my $num1 = <STDIN>); my $num1; my $num2 = 2; my $result; $result = $num1 + $num2; print "result is: $result\n"; #return result; }
In reply to Re^2: calling subroutines
by bobosm
in thread calling subroutines
by bobosm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |