in reply to typeglob: $var = *x ???
What does $fh = *NAME accomplish
It puts the symbol table entry for NAME, a type glob (aka glob aka GV), in $fh.
and how can I use $fh?
@{ *$var{ARRAY} }, or even @{ *$var } or @{ $var }.
$ perl -E'@x=qw( a b c ); $var = *x; say for @{ *$var{ARRAY} }' a b c
All three also work if $var = \*x;.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: typeglob: $var = *x ???
by 7stud (Deacon) on Jun 16, 2011 at 01:17 UTC | |
by ikegami (Patriarch) on Jun 16, 2011 at 02:34 UTC | |
by 7stud (Deacon) on Jun 16, 2011 at 08:23 UTC | |
by ikegami (Patriarch) on Jun 16, 2011 at 15:30 UTC |