in reply to calling subroutines
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: calling subroutines
by bobosm (Initiate) on Oct 12, 2013 at 16:06 UTC | |
by davido (Cardinal) on Oct 12, 2013 at 16:13 UTC | |
by bobosm (Initiate) on Oct 12, 2013 at 16:25 UTC | |
by davido (Cardinal) on Oct 12, 2013 at 17:44 UTC | |
|
Re^2: calling subroutines
by bobosm (Initiate) on Oct 12, 2013 at 16:16 UTC | |
by davido (Cardinal) on Oct 12, 2013 at 16:27 UTC | |
by bobosm (Initiate) on Oct 12, 2013 at 16:34 UTC | |
|
Re^2: calling subroutines
by builat (Monk) on Oct 13, 2013 at 05:46 UTC |