in reply to Tricky syntax with hash ref. slicing

The %s are unnecessary, so you can wipe one level of dereferencing there.

@{ $rhPublicHandles }{ @publicHandles } = @{ $rhHandles->{handles} }{ @publicHandles };

If you're worried about verbosity, you could stick $rhHandles->{handles} into a temporary scalar; however if this is the one and only place you're referring to it in this particular scope it's probably overkill (whereas if you're using it several times it might make things a little cleaner).

Update: maybe play with the formatting and make things line up?

@{ $rhPublicHandles }{ @publicHandles } = @{ $rhHandles->{handles} }{ @publicHandles };

Replies are listed 'Best First'.
Re^2: Tricky syntax with hash ref. slicing
by johngg (Canon) on Mar 10, 2006 at 16:29 UTC
    So they are, wow! How does that work? I thought I would have to get right back to the hash by de-referencing with %{...} before being able to move forward again slicing out a list @{...}.

    Another example of Perl automagically doing clever things. Yes, I was only referring to it twice actually and I did consider a temporary scalar for $rhHandles->{handles} but decided not to more to see if I could crack the problem.

    Thank you,

    JohnGG