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 |
In reply to Re: $ARGV dilemma
by blue_cowdawg
in thread $ARGV dilemma
by dusk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |