# New Ticket Created by  Jeff Horwitz 
# Please include the string:  [perl #61826]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61826 >


assume the following three files:

Bar.pm:
     say "in Bar.pm";

foo1.p6:
     module Foo;
     use Bar;
     say "in Foo";

foo2.p6:
     use Bar;
     module Foo;
     say "in Foo";

the output of foo1.p6 and foo2.p6 is the same when run using the p6 
source:

[j...@groovy perl6]$ ../../parrot perl6.pbc foo1.p6
in Bar.pm
in Foo
[j...@groovy perl6]$ ../../parrot perl6.pbc foo2.p6
in Bar.pm
in Foo

however, compile the scripts to PIR and the following happens:

[j...@groovy perl6]$ ../../parrot foo1.pir
in Foo
in Bar.pm
[j...@groovy perl6]$ ../../parrot foo2.pir
in Bar.pm
in Foo

foo1.pir behaves differently from its p6 source -- it processes the "use" 
*after* executing the body of the script, which is incorrect.  the 
placement of the module declaration is the only difference.

-jeff

Reply via email to