Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Sub::Context (Re: ... returned in scalar context)
in thread What should be returned in scalar context?

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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://313007]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found