in reply to (Some) inconsistencies with IO built-ins, their documentation and filehandle names ("symbolic references")
Maybe some historical background is helpful.
IIRC were lexical filehandles (with private variables and strict) only introduced with Perl5 (not even the first versions)
They are held in one of the 6 slots of a typeglob and were referenced by a uppercase bare word like "FH" named like the glob.
So writing FH meant using *FH{IO} like calling a sub "func()" meant using *func{CODE}->(). °
In order to be able to pass a filehandle as argument to a sub, you had to write *FH.
With Perl 5 came the need for lexical my $fh and avoiding typeglobs altogether while staying backwards compatible.
Now that's how the mess with alternative syntax started, and the docs retain a lot of old wording.
Ikegami already listed various different possibilities to denote a filehandle.
DISCLAIMER:
That's what I understood in the last 10 years lurking here in the monastery, I never coded Perl 4, so some details may be wrong.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) I think even this hash-like syntax to address slots in a glob didn't exist back then...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: (Some) inconsistencies with IO built-ins, their documentation and filehandle names ("symbolic references")
by vr (Curate) on Jun 10, 2020 at 09:39 UTC | |
by LanX (Saint) on Jun 10, 2020 at 09:54 UTC | |
by syphilis (Archbishop) on Jun 10, 2020 at 12:24 UTC | |
by LanX (Saint) on Jun 10, 2020 at 12:34 UTC |