Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Length of Array Passed as Reference

by haukex (Archbishop)
on Dec 10, 2020 at 09:16 UTC ( [id://11124934]=note: print w/replies, xml ) Need Help??


in reply to Re: Length of Array Passed as Reference
in thread Length of Array Passed as Reference

@_ is a list so assignment in a scalar context will get you the length of the list

I think the distinction between list and array is important here. An array in scalar context returns its length, a literal list in scalar context returns its last element. @_ is an array.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124934]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found