in reply to $ARGV dilemma
Check out the following:
--$ cat argvtest.pl #!/usr/bin/perl -w ################################################################### use strict; print "too few$/" if scalar(@ARGV) < 3 ; print "just right$/" if scalar(@ARGV) == 3; print "too many$/" if scalar(@ARGV) > 3; --$ perl argvtest.pl 1 2 too few --$ perl argvtest.pl 1 2 3 just right --$ perl argvtest.pl 1 2 3 4 too many --$
scalar is your friend! ;-)
HTH
| Peter L. Berghold | Schooner Technology Consulting, Inc. |
| Peter@Berghold.Net | www.berghold.net |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: $ARGV dilemma
by blakem (Monsignor) on May 27, 2001 at 16:47 UTC | |
by blue_cowdawg (Monsignor) on May 27, 2001 at 16:52 UTC |