in reply to Compile order sanity check
use and require execute all of the top level code of the module before returning (unless this has already been done by an earlier use and require), so you are safe.
Update: As pointed out by wsfp in chat, it's pointless to export $globalVariable. That exports the unused package variable $globalVariable rather than the lexical (my) variable $globalVariable. The simple fix would be to change
my $globalVariable = ...;
to
our $globalVariable = ...;
|
|---|