Karl Glazebrook <[EMAIL PROTECTED]> writes:

> o Why do I think perl has too much line noise? Because of code like this:

>   @{$x->{$$fred{Blah}}}[1..3]

You're taking the value of the key "Blah" in the hash referred to by $fred
and using it as the key into the hash referred to by $x, treating the
value as an anonymous array and taking a slice containing the 2nd through
the 4th elements.

Hm.  Personally, I think that's a very *small* amount of line noise for
expressing an action so complicated it takes more than three lines of
English text to explain what's going on.  Expressions that do complicated
things are going to look complicated.

If you want to cut down on the line noise, temporary variables are the
standard tool:

    my $key = $$fred{Blah};
    my $array = $$x{$key};
    @$array[1..3];

And finally, what causes all the line noise here are the curlies.
Removing the *one* @ in that expression isn't going to make it look any
simpler.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to