in reply to How to get a slice of hash ref that a sub returns.

OK, I got it (after I tried several million things):

sub x { return {qw(a b c d)}; } print @{%{x()}}{"a","c"};

The trick was to kill the arrow (even though I am not yet sure why).

Replies are listed 'Best First'.
(tye)Re: How to get a slice of hash ref that a sub returns.
by tye (Sage) on Apr 18, 2002 at 21:56 UTC

    You can drop the %{}:

    sub x { return {qw(a b c d)}; } print @{x()}{"a","c"};
    I find that references quick reference makes this stuff easy to remember.

            - tye (but my friends call me "Tye")