Jonathan Lang wrote:
Dave Whipp wrote:

Or we could view it purely in terms of the design of the core "strict"
and "warnings" modules: is it better to implement them as centralised
rulesets, or as a distributed mechanism by which "core" modules can
register module-specific strictures/warnings/diagnostics.


Question: if module A uses strict, and module B uses module A, does
module B effectively use strict?  I hope not.

I was under the impression that pragmas are local to the package in
which they're declared.  If that's the case, then pragmas will not
work for allowing one module to impose restrictions on another unless
there's a way to export pragmas.


I think your hopes are fulfilled: stricness is not transitive. However, that's not what I was suggesting. What I was suggesting was that if Module A uses "strict", and Module A uses something from Module B, then Module B should be able to do additional checks (at either runtime or compile time) based on the strictness of its caller. For example I might write:

  use strict;
  my Date $date = "29 February 2001";

and get a compile time error (or perhaps warning); but without the "use strict" the Date module might interpret the string (which comes from it's caller) as "1 March 2001".

Reply via email to