On 09/06/10 13:14 +0530, Gopal Karunakar wrote:
How can i declare a simple perl script file which will take arguments
from the user? an example will be take two numbers and give the sum as
output.
use strict;
print calc(@ARGV);
sub calc {
my @to_add = @_;
my $i = 0;
for my $num(@to_add) {
$i += $num;
}
return $i;
}
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
