RE: checking parameters ...

2002-09-26 Thread Sudarshan Raghavan
On Fri, 27 Sep 2002, Anurag K. Singh wrote: > use or instead of && like : > > if (($ARGV[0] eq "") or ($ARGV[1] eq "") or ($ARGV[2] eq "")) { > print "You must give me 3 parameters\n"; > exit > } > > It works for me. 1) If I were to use your program how would I pass an empty strin

RE: checking parameters ...

2002-09-26 Thread Anurag K. Singh
hone: +357-25-845384(O) -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 6:12 PM To: [EMAIL PROTECTED] Subject: Re: checking parameters ... Admin-Stress wrote: > > I wrote a simple script like this : > > #!/usr/bin/perl &

Re: checking parameters ...

2002-09-26 Thread Michael Fowler
On Thu, Sep 26, 2002 at 07:30:37AM -0700, Admin-Stress wrote: > I can use "if (scalar(@ARGV) < 3) {...}" but that not the case. If the user executes the program like so: program.pl foo bar @ARGV will have 2 elements. If the user executes the program like so: program.pl "" "" "" @ARGV

Re: checking parameters ...

2002-09-26 Thread John W. Krahn
Admin-Stress wrote: > > I wrote a simple script like this : > > #!/usr/bin/perl > > if (($ARGV[0] eq "") && ($ARGV[1] eq "") && ($ARGV[2] eg "")) { >print "You must give me 3 parameters\n"; >exit; > } > > Then, I tested like with 1 .. OR 2 ... OR 3 parameters, it did not print the text

RE: checking parameters ...

2002-09-26 Thread Nikola Janceski
change && to || > -Original Message- > From: Admin-Stress [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 10:31 AM > To: Perl beginners > Subject: checking parameters ... > > > I wrote a simple script like this : > > #!/usr/bin/pe

checking parameters ...

2002-09-26 Thread Admin-Stress
I wrote a simple script like this : #!/usr/bin/perl if (($ARGV[0] eq "") && ($ARGV[1] eq "") && ($ARGV[2] eg "")) { print "You must give me 3 parameters\n"; exit; } Then, I tested like with 1 .. OR 2 ... OR 3 parameters, it did not print the text "You must...". Why this happened? How to