my $local = ((($n/3) !~ /\./) ? "[$n] set" : "");
Now, about this being a bug...
But I think that this is a bug, specially because is hard to understand why it happens!
A lot of people who haven't seen closures before
think it's hard to understand why
closures work the way they do -- does that make them
a bug? Continuations are even weirder and harder
to understand. Perl5 doesn't have them, but Scheme
considers them important, and I think we're getting
them in Perl6. Will they be a bug if you don't
understand them?
A bug is when the compiler/interpreter/whatever does
something different than what it's *intended* to do,
not when you don't understand the reasons behind why
it's doing what it's doing.
Now, in this particular case, davido has
pointed out that the behavior is
undefined. I personally feel that the mere
existence of undefined behavior is a Bad Thing(TM),
and that a language should nail down the behavior
of everything that's not a syntax error. However,
that's a philosophical position I have, a design
issue -- failure of Perl to do that is a
design choice (albeit one I disagree with),
not a bug. chromatic's note
makes me suspect it was left the way it is for
reasons of efficiency -- another design choice I
personally disagree with (I always favour robustness
and definedness over optimization), but nevertheless
a design choice, not a bug. perl is doing what it
was intended (by the people who created it) to do.
So filing a bug report is unlikely to have any
useful effect.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|