http://www.perlmonks.org?node_id=1057999


in reply to Re: calling subroutines
in thread calling subroutines

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; }