What's the dif between: @_[0] and $_[0] ?

U

user

Same question for arrays in general:
e.g. @myArray[3] vs. $myArray[3]

Most texts I've seen use the scalar version, but I've also seen the
array version. In simple testing I can't find a difference. Is this
just a case of "there's more than one way to do things", or are there
subtle differences I'm too new to have seen?

Thanks.
 
G

Gunnar Hjalmarsson

user said:
Same question for arrays in general:
e.g. @myArray[3] vs. $myArray[3]

Most texts I've seen use the scalar version, but I've also seen the
array version. In simple testing I can't find a difference. Is
this just a case of "there's more than one way to do things", or
are there subtle differences I'm too new to have seen?

Enable warnings, and you'll notice a difference.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top