in reply to Re: Worst thing you ever made with Perl
in thread Worst thing you ever made with Perl

This was in the context of interpolation. Operators aren't interpolated, generally speaking. (Yeah, I know, methods are interpolated in Perl6... Perl6 is different in a number of ways (some of which I look forward to, but I digress).) In Perl5, $foo{bar} is a scalar value -- hence, the scalar sigil. If you were referring to the hash value foo, it would be spelled %foo, and then anything that followed would be an operator. (Again, I know a lot of this changes in Perl6... but there are other corresponding changes surrounding it that give a consistency Perl5 wouldn't have if $foo were to refer to %foo in the way you seem to imply.) As it stands, $foo{bar} is a single scalar value. That's my story and I'm sticking to it.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

Replies are listed 'Best First'.
Re: Worst thing you ever made with Perl
by Abigail-II (Bishop) on Oct 01, 2003 at 19:27 UTC
    I've never disputed that '$foo {bar}' is a single scalar value. But so are '$_ x 5' and '-M $0'. Just the fact that expressions result in single scalar values, doesn't mean one can't sprinkle whitespace between tokens to make things more readable.

    Abigail