# New Ticket Created by Chris Dolan # Please include the string: [perl #63226] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=63226 >
If you include statements in the body of a package, class, etc. declaration, those are executed at :load time which happens before :main. So, globals like @*ARGS which are set up in ! UNIT_START from :main are not yet established. All three of the following examples should have the same results, but the middle one is wrong. Either setup of globals needs to happen before :load, or the statements in the package, class, etc. need to be moved out of :load methods. I think the latter is better, since :load methods are like BEGIN blocks. ../../parrot perl6.pbc -e 'say "(", @*ARGS, ")";' f g h (fgh) ../../parrot perl6.pbc -e 'package Foo { say "(", @*ARGS, ")"; }' f g h () ../../parrot perl6.pbc -e 'package Foo { sub run() { say "(", @*ARGS, ")"; } }; Foo::run()' f g h (fgh)