Yes, this is semi-related to the 'my $a if 0;' behavior.

Out of morbid curiosity (since I'm working on documentation), given the 
program that the following program generates:

#!/your/path/to/perl -w    # perl 5.6.1
my @l = ('a' .. 'g');
my $my = 0;

for my $v (@l) {
   my @a = map { "\$$v .= '$_'" } @l;
   $a[$my++] = "my $a[$my]";
   print shift @a,                     ";\n{\n    ",
         join (", ", @a[@a/2 .. $#a]), " if ",
         join (", ", @a[0 .. @a/2-1]), ";\n";
   print <<"EOF";
   print "$v: \$$v\\n"; 
}
print "$v: \$$v\\n";

EOF
}
__END__

I'm found tests B, C, and D a little surprising.   I expected 'befg/acd', 
'cefg/abd', and 'defg/abc' (lexical/global answers, respectively).

Although I now understand what it does, I'm still fuzzy on the why and how.  
Can someone in the know give a clear enough explanation that I can document?

The rest of you can debate whether or not this behavior should change for 
Perl 6.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to