@list = ("fred","barney","betty");
$a = reverse @list; # reverse in scalar context
print "$a\n"; # should print "derf" according to my reading of docs
# but instead prints "yttebyenrabderf"
so it looks like a join "" followed by reverse is happening. This doesn't
really match well with the docs. Does the same in perl4.036 as well.
It certainly surprised me. And I've been using Perl for a while. :-)
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
$a = reverse @list; # reverse in scalar context
print "$a\n"; # should print "derf" according to my reading of docs
# but instead prints "yttebyenrabderf"
so it looks like a join "" followed by reverse is happening. This doesn't
really match well with the docs. Does the same in perl4.036 as well.
It certainly surprised me. And I've been using Perl for a while. :-)
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me