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 = ...;
In reply to Re: Compile order sanity check
by ikegami
in thread Compile order sanity check
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |