revdiablo has asked for the wisdom of the Perl Monks concerning the following question:
Simple question, but this is really puzzling me. Why does this work?
use strict; use warnings; open my $fh, "somefile"; my $sc = *$fh{IO}; print <$sc>;
I thought the *FOO{THING} syntax only worked with package variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: *FOO{THING} syntax used on a lexical variable
by tilly (Archbishop) on Jun 12, 2005 at 07:02 UTC | |
by revdiablo (Prior) on Jun 12, 2005 at 07:28 UTC | |
|
Re: *FOO{THING} syntax used on a lexical variable
by ysth (Canon) on Jun 12, 2005 at 07:53 UTC | |
by nobull (Friar) on Jun 12, 2005 at 12:44 UTC | |
by ysth (Canon) on Jun 13, 2005 at 03:42 UTC | |
by Anonymous Monk on Jun 12, 2005 at 14:54 UTC |