XP is just a number | |
PerlMonks |
Re: Sub::Context (Re: ... returned in scalar context)by theorbtwo (Prior) |
on Dec 08, 2003 at 05:06 UTC ( [id://313007]=note: print w/replies, xml ) | Need Help?? |
This sounds useful to me. OTOH, I think you're missing some. :last and :count you should have, if only for completeness. :uselessvoid should give warnings if called in void context. :mutatevoid would set $_[0] to the return if used in void context. :warnscalar would warn if called in scalar context. :loop would do the close equivlent of tilly's if @_>1: when called in list context, with more then one arg, just run through the sub for each argument. Upon reading the update: Oh. I have to say, I like your API better then chromatic's, but see how both could be good in different circumstances. Perhaps you should find another namespace for yours? Update: Fixed minor markup issue, thanks ysth. Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).
In Section
Meditations
|
|