use warnings; use strict; for ( 1 .. 5 ) { some(); } sub some { print "Enter a number: \n"; chomp( my $num1 = <STDIN> ); my $num2 = 2; my $result; $result = $num1 + $num2; print "result is: $result\n"; }
If you want it to do something different, you must be much more specific. See also perlintro
In reply to Re: calling subroutines
by toolic
in thread calling subroutines
by bobosm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |