Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: function call / return philosophies

by ehdonhon (Curate)
on Sep 03, 2004 at 19:03 UTC ( #388380=note: print w/replies, xml ) Need Help??


in reply to function call / return philosophies

Varying return types has always caused problem for me down the road. Best thing to do might be to always return ref regardless of the number of parameters you receive.

I think a hashref here is a better return value than an array ref. Perl already has hashes built in. If you return an array ref, you are forcing the user of your API to re-implement associative arrays.

  • Comment on Re: function call / return philosophies

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://388380]
help
Chatterbox?
[Corion]: A good morning to everybody!
[Lady_Aleena]: Morning Corion.
[Corion]: I spent yesterday evening (and early night) in VR in Vanishing Realms, and can really recommend it
Discipulus is a very sad mornig anyway..
[Corion]: The title/"cover" image doesn't convey the comic/painted style, and the gameplay is really diverse, especially for a VR game

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-05-23 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?