in reply to *glob{FILEHANDLE}
Not meaning to plug (but will anyway) I'd recommend Of Symbol Tables and Globs for more info on globs and glob slots.open(FH, $0); print "*FH IO slot holds - ", *FH{IO}, $/; __output__ *FH IO slot holds - IO::Handle=IO(0x8107e4c)
How/where/why it is used? Please give me example.Accessing glob slots directly is very rarely done, and when it is, it's usually for doing low-level code like writing Exporter type code. Here's a simple demo of such code (if somewhat contrived)
sub import { my $pkg = caller; ## import only filehandles *{"$pkg\::$_"} = *{__PACKAGE__."::$_"}{IO} for keys %{__PACKAGE__."::"}; }
_________
broquaint
update: s/DIR/CODE/ + added example
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: *glob{FILEHANDLE}
by rakesh1377 (Novice) on Jun 18, 2003 at 11:15 UTC | |
by broquaint (Abbot) on Jun 18, 2003 at 11:22 UTC |