(Hi, golfers! I'm really glad this game got started -- I was on fwp in its
first incarnation for some golf discussions, though they didn't have
tournaments back then -- but it's SO time consuming. I pretty much have to
get all my work done three weeks a month...)
This is pretty weird to me to. However, Lars suggested it's a 5.6 thing, and
I don't think so. Viz.:
>perl -v
This is perl, version 5.004_04 built for sun4-solaris
>perl -wle '@a=qw(e d c b a); for(sort @a){s/./uc($&)/e};print @a'
EDCBA
However,
>perl -wle '@a=qw(e d c b a); for(@b=sort @a){s/./uc($&)/e};print @a'
edcba
In fact, it's not just sort:
>perl -wle '@a=qw(e d c b a); for(reverse @a){s/./uc($&)/e};print @a'
EDCBA
In fact:
>perl -wle '@a=qw(e d c); @c=qw(b a); for(@a,@c){s/./uc($&)/e};print @a,@c'
EDCBA
But:
>perl -wle '@a=qw(e d c); @c=qw(b a); for(@a,@d=@c){s/./uc$&/e};print
@a,@c,@d'
EDCbaBA
Some more data?
>perl -wle '%a=qw(a b c d); for(%a){s/./uc$&/e};print %a'
abcd
>perl -wle '%a=qw(a b c d); for(keys %a){s/./uc$&/e};print %a'
abcd
For a moment, I thought that maybe sort@a is a sort of lvalue such that
inside the for loop it can be talked to. But
>perl -wle '@a=qw(e d c); (sort@a)=(1,2,3)'
Can't modify sort in list assignment at -e line 1, at EOF
???
Amir Karger
CuraGen Corporation
LEGAL NOTICE - Unless expressly stated otherwise, this message is
confidential and may be privileged. It is intended for the addressee(s)
only. Access to this e-mail by anyone else is unauthorized. If you are not
an addressee, any disclosure or copying of the contents or any action taken
(or not taken) in reliance on it is unauthorized and may be unlawful. If you
are not an addressee, please inform the sender immediately.