in reply to Re: Error with using structs as subroutine parameters
in thread Error with using structs as subroutine parameters
should be listed at the beginning of a file, not inside of subroutines.Why? If you only need a module inside the subroutine, keeping the 'use' close to its usage means that if you later on remove the subroutine, you're not left 'using' a module that isn't actually used.
I'm not sure, but use of a class inside a subroutine might lead to problems because the implied 'require' would create closures instead of sub-subroutines.Rubbish. It will not create closures, and Perl doesn't have any concept of "sub-subroutines" (what are they? Really tiny routines?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Error with using structs as subroutine parameters
by jethro (Monsignor) on Jun 08, 2009 at 12:45 UTC |