scalar context for testing arguments

F

fvdmarkt

Hi,


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?
 
X

xhoster

Hi,

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?

I prefer:

if (@ARGV) {

Xho

--
-------------------- 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top