There's more than one way to do things | |
PerlMonks |
Re: Context aware functions - best practices?by runrig (Abbot) |
on Jan 14, 2003 at 18:33 UTC ( [id://226918]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|