in reply to Where in a package should 'use' be called?

As you say, where you use a module matters not in Perl 5 and I have done it both ways over past years. But this year, since I am now cognizant of Perl 6's module scoping rules, I put the module use statement in a subroutine unless it is to be used in more than one scope.

Replies are listed 'Best First'.
Re^2: Where in a package should 'use' be called?
by stevieb (Canon) on Sep 28, 2015 at 00:42 UTC

    Thanks u65... a few years ago, I toyed with Perl6 because moritz's at-the-time PM sig tested my patience (you can see my very basic p6 'testing' here). After getting set up, I appreciated quite a few things (and was upset due to others) but I especially liked calling a method on a literal, eg: say 25.WHAT :). Up until now, I did not know that use was kept within lexical (ie. block) scope and not compile-time in P6. Is this true?

    For now, I'm looking specifically for Perl5 best practice.