Is it okay to use modules from within subroutines?
问题 Recently I start playing with OO Perl and I've been creating quite a bunch of new objects for a new project that I'm working on. As I'm unfamilliar with any best practice regarding OO Perl and we're kind in a tight rush to get it done :P I'm putting a lot of this kind of code into each of my function: sub funcx{ use ObjectX; # i don't declare this on top of the pm file # but inside the function itself my $obj = new ObjectX; } I was wondering if this will cause any negative impact versus