in reply to Re^4: map question (hash slice)
in thread map question

> For "objects", you'd need

No not if the array has only refs.

Collision can only happen if a string looks like a string representation of a ref.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^6: map question (hash slice)
by ikegami (Patriarch) on Jul 31, 2019 at 06:17 UTC

    Maybe. Depends on whether you are checking for identity or equality. If you are checking for identify, then yeah, the key sub could simply return its argument, giving your original code.

    So my comment stands. Your solution is a specific case of my code that only works if one makes multiple assumptions.