in reply to Re^5: Where and when you should place 'use module;'?
in thread Where and when you should place 'use module;'?

Can you show us how you tested this? I think that you are mistaken. The term 'file scoped' only makes sense with respect to lexical scopes in Perl, and import doesn't have access to the caller's lexical scope unless you play around with something like PadWalker.

Here is a counter example:

## file one.pl: use strict; use warnings; use Data::Dumper; require "./two.pl"; ## file two.pl: print Dumper [1,2,3]; ## output: $VAR1 = [ 1, 2, 3 ];

Replies are listed 'Best First'.
Re^7: Where and when you should place 'use module;'?
by Moron (Curate) on Oct 13, 2005 at 11:37 UTC
    ++ for thinking of require as a counter-example.

    -M

    Free your mind