I need help, i am new in Perl if you can help me i have a question:
I want to know how to Random generate 5 number in (num1) outside of subroutine (some) Then 5 times calls the subroutine and then displayed the results.
sub some() { print "Enter a number: \n"; chomp (my $num1 = <STDIN>); my $num2 = 2; my $result; $result = $num1+$num2; print "result is: $result"; #return result; }
In reply to calling subroutines by bobosm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |