scalar context for testing arguments

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


Is this the right way to test for existence of arguments?

if (@ARGV > 0) {

or should I use the index of the last argument?

if ($#ARGV >= 0) {

Who has a better suggestion?

Re: scalar context for testing arguments wrote:
Quoted text here. Click to load it

I prefer:

if (@ARGV) {


-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Site Timeline