in reply to Interrogating stashes - Camel example doesn't work?

The "*foo{THING}" notation is used to get a reference to a slot of a typeglob or undef if that slot is unused (except that it creates a scalar if one doesn't exist).

You want:
... if *sym{ARRAY}; ... if *sym{HASH};
or *{ $main::Env::{$symname} }{ARRAY} or even just *{ $Env::{$symname} }{ARRAY}.

Replies are listed 'Best First'.
Re^2: Interrogating stashes - Camel example doesn't work?
by Intrepid (Curate) on Jul 28, 2025 at 00:54 UTC

    ysth wrote:

    The "*foo{THING}" notation is used to get a reference to a slot of a typeglob (...)

    I'm glad you added this knowledge to the thread, ysth, it's an important even if rather rarely used notation (I think). I remembered having applied myself to study of this "*foo{THING}" technique in the dim past. Thanks!

        - Soren

    Jul 28, 2025 at 00:54 UTC