XP is just a number | |
PerlMonks |
Re: Context aware functions - best practices?by shotgunefx (Parson) |
on Jan 15, 2003 at 01:50 UTC ( [id://227027]=note: print w/replies, xml ) | Need Help?? |
I see nothing wrong with this idiom. It's how I would do it, but if you were worried about generating the extra data (Which in this case your not) I would recommend looking at Want. "wantarray on steriods". In this example you could use the howmany() sub to determine how many items the caller wants.
But for most cases I would stick to plain ol' wantarray() -Lee "To be civilized is to deny one's nature."
In Section
Seekers of Perl Wisdom
|
|