On 07/23/2013 04:37 PM, Jim Schueler wrote:
One option is to release this module as a pragma. Note the difference in
invocation:
## Function::ReturnScalar name used in blog example
use Function::ReturnScalar ; ## pragma
use base Function::ReturnScalar ; ## standard
a small remark: "pragma", in Perl, means by convention a lowercase-named
module, like eg. "use strict".
you seem to be using "pragma" in the sense of a module which, when used,
changes the normal behaviour of something (sub definition, in this
case). and I agree with others (Aristotle, for example) in saying that
this would be a bad idea.
regarding the "other option", eg. the attribute way, there seems to be a
module already on CPAN for this:
http://search.cpan.org/~ovid/Attribute-Context-0.042/lib/Attribute/Context.pm
cheers,
Aldo