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