in reply to Use of Carp outside of package won't compile...
strict and Carp operate by somewhat different mechanisms. strict is scoped lexically, and so applies for the whole scope in which it is declared (in this case file scope), covering the subsequent package declaration. Carp works by exporting its functions to the calling namespace. In your example, Carp exports croak to the default package (main) but not to your Test package. When you change it to put the use Carp statement inside your package, then it works because croak gets exported to the Test namespace.
|