Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Context aware functions - best practices?

by runrig (Abbot)
on Jan 14, 2003 at 18:33 UTC ( #226918=note: print w/replies, xml ) Need Help??


in reply to Context aware functions - best practices?

I think I would just put parens around the $x. I'd only use wantarray if I wanted to return something besides the first element of the array that would otherwise be returned, like an array reference or whatever.

Update: /me changes his mind. I'll agree, typing a bit more in the function does save you from remembering to type all those parens in the usage of the function, so go ahead and use wantarray just like you have.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://226918]
help
Chatterbox?
[stevieb]: ffs... an hour I've been trying to get a Pi to communicate I2C to an Arduino. Had to slow down the communication channel. Sigh

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2017-06-22 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.