Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Need explanatiin for subtle difference

by BillKSmith (Monsignor)
on May 26, 2015 at 20:05 UTC ( [id://1127884]=note: print w/replies, xml ) Need Help??


in reply to Need explanatiin for subtle difference

A good explanation is somewhat more subtle than other monks have indicated. First, we must realize that return inherits its context from the use of the function call. In both of your cases, it is scalar context. The difference between an actual array and a list in scalar context is documented in List Value Constructors. In your example, we should expect the array size from an actual array and the last element from a list. This is what you report.
Bill
  • Comment on Re: Need explanatiin for subtle difference

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found