Re: Perl file with arguments

2010-06-09 Thread Shlomi Fish
On Wednesday 09 Jun 2010 10:44:35 Gopal Karunakar wrote: > Hi, > > 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. > > Thanks in advance, > See @ARGV: [code] #!/usr/bin/perl use stric

Re: Perl file with arguments

2010-06-09 Thread trapd00r
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_

AW: Perl file with arguments

2010-06-09 Thread Thomas Bätzler
Gopal Karunakar asked: > 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. Do you want to pass the arguments on the command line or prompt for them after starting your script? In the firs

Perl file with arguments

2010-06-09 Thread Gopal Karunakar
Hi, 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. Thanks in advance, GK.