[comp.lang.perl] Syn-taxing filehandles

flee@shire.cs.psu.edu (Felix Lee) (03/08/90)

Urf, I just noticed this:
>	printf(wow "%s\n", $header[$i]);

Why is this syntax supported?  The filehandle inside the parentheses
looks very weird.  This:
	printf wow ("%s\n", $header[$i]);
looks much better (and happens to already work).

And why are you allowed to indirectly create filehandles that you
can't use literally?
	open("!stunky!fluff!", "wow");
	$x = "!stunky!fluff!";
	print <$x>;
If you say
	print <"!stunky!fluff!">;
you get globbing instead (and an "Event not found" from csh).

And why aren't filehandles syntactically distinguished, like other
user objects?  metaconfig 2.0 uses the filehandle 'package', which
broke when Perl introduced the 'package' keyword.  You could just use
indirect filehandles all the time, but that feels blecch.

People seem to confuse the <wow> syntax with a filehandle object; if
it were a filehandle object, you'd say things like:
	open <wow>, "> wow";
	<wow> = ("hello", ", world\n");
	<wow> = <stdin>;
	<wow> = sprintf "%x\n", 169845242;
	close <wow>;
Offhand, I can't think of anything that this would break, but then,
I'm not Not Just Another Perl Hacker.

Just random banging on the wall,
--
Felix Lee	flee@shire.cs.psu.edu	*!psuvax1!flee