karthikasasanka has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way to write a pragmatic module.
so that some rules to set if we use that pragma.

example:
strict applies scope declaration rule.

Replies are listed 'Best First'.
Re: writing a pragma
by choroba (Cardinal) on Apr 25, 2014 at 15:31 UTC
      Well, strict is not a good example as it is just a thin wrapper to enable/disable functionality that is actually implemented on the C side of the perl interpreter.

      How to write pragmas is documented in perlpragma. The entry for %^H in perlvar contains also some bits of information.

        thanks for the answer. helped a lot. is there a way to write a module to work like strict. so that does something at compile time?