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

Re: What should be returned in scalar context?

by vacant (Pilgrim)
on Dec 03, 2003 at 05:33 UTC ( [id://311833]=note: print w/replies, xml ) Need Help??


in reply to What should be returned in scalar context?

I guess I would have to ask just how often is this really an issue? Once I got over the shock of having the language automatically adjust to the context, it looked like merely a convenience to me. In other words, when I write a function, I usually know whether I want the result as a scalar or an array.

Of course, if the function is for "public" consumption, the return type should be specified in the documentation as well as in the comments preceeding the function.

So far as "standardizing" goes, I think I agree with those who don't standardize. So long as the function is documented properly, why not write in whatever manner best fits its purpose?

  • Comment on Re: What should be returned in scalar context?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-19 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found