in reply to symbol/glob hash explanation
Where can I find the gory details of this construct used by glob/symbol-based modules
See Typeglobs and Filehandles in perldata.
Is there another way to access that hash?
If $sym contains 'fred', then ${*$sym}{hash_key} = 'something'; is equivalent to $fred{hash_key} = 'something';.
Or strictly:
our %fred; $fred{hash_key} = 'something';
I can't find the equivalent of the STDIN example. Where is it stored? Is it a hash that's magically not accessible by name?
There is a hash (and array and scalar et al.) associated with the STDIN glob:
they just aren't normally used for anything.c:\test>perl -E"${*STDIN}{fred} = 'bill'; say $STDIN{fred}" bill
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: symbol/glob hash explanation
by rwstauner (Acolyte) on May 03, 2011 at 04:36 UTC | |
by BrowserUk (Patriarch) on May 03, 2011 at 04:43 UTC | |
by rwstauner (Acolyte) on May 03, 2011 at 14:09 UTC | |
by BrowserUk (Patriarch) on May 03, 2011 at 15:21 UTC | |
by rwstauner (Acolyte) on May 03, 2011 at 16:55 UTC |