>But I do agree it would be nice if there were a way to simultaneously
>construct and dereference an anonymous array or list, perhaps something 
>like 
>       @( 1, 2, 3 )
>       %( foo => 1, bar => 2 )

>which would be equivalent to

>       @{[ 1, 2, 3 ]}
>       %{{ foo => 1, bar => 2 }}

>but with perhaps lower overhead.

You're working too hard.

    [ 1, 2, 3 ]
    { foo => 1, bar => 2 }

as in 

    $name = 'foo';
    $value = { foo => 1, bar => 2 }->{$name};

Not that I'm claiming this is excessively efficient, but
it's already there.  One just works on the compiler to 
be smarter on optimizing.  Or the programmer:

    $table = { foo => 1, bar => 2 }->{$name};
    $name = 'foo';
    $value = $table->{$name};

--tom

Reply via email to