Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: What's happening in this expression?

by Anonymous Monk
on Oct 12, 2020 at 15:18 UTC ( #11122747=note: print w/replies, xml ) Need Help??


in reply to What's happening in this expression?

If you need to "return multiple values," I suggest that you define a (special, just for this purpose) object with a method that can populate (in this case, four) well-defined properties. Instantiate the object, call the method, use the properties. If you try to "return a list," I find that it's just too easy to get it wrong, plus every call to the function must be manually checked every time any change is made. It is thus a very fragile construction, IMHO best to be avoided. By comparison, objects are flexible and self-descriptive.
  • Comment on Re: What's happening in this expression?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2020-12-04 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (60 votes). Check out past polls.

    Notices?