http://www.perlmonks.org?node_id=11107718


in reply to why package definition order affect the available of package variable

The package statement doesn't affect execution order: $global = "I'm in the testEnd package global version"; is executed after the testEnd::show_me() call, so $testEnd::global is still undef at that point in time.

Note that you should always Use strict and warnings.

Replies are listed 'Best First'.
Re^2: why package definition order affect the available of package variable
by fanasy (Sexton) on Oct 20, 2019 at 14:03 UTC

    thanks for your quick answer.
    that's the point.