develooper Front page | perl.perl6.language.io | Postings from September 2000

Re: RFC 30 (v4) STDIN, STDOUT, STDERR, ARGV, and DATA should become scalars

Thread Previous | Thread Next
From:
Eryq
Date:
September 14, 2000 16:51
Subject:
Re: RFC 30 (v4) STDIN, STDOUT, STDERR, ARGV, and DATA should become scalars
Message ID:
39C1648A.77AF0E12@zeegee.com
"David L. Nicol" wrote:

> File handles work perfectly well
> right now as undecorated terms with well defined characteristics

Perfectly well?

	* Have to use ugly globref syntax to pass them around reliably.
	* Not first-class objects, so you can't subclass them.
	* Special syntax to reassign STDOUT, instead of just $STDOUT = $foo.
	* Stupid "gensym" tricks to create unique names.
	* Do they even *get* garbage-collected they way real objects do???
	* STDOUT->flush barfs if you don't "use FileHandle" first; sheesh.
	* The "tiehandle" mechanism (blech). 

I don't know.  If Perl didn't work this way and I proposed **adding** 
such a monstrosity to the language, the community would laugh in
my face, spit on my camel, and revoke my PAUSE account. 

You can't even say that there's more typing involved to make
the change, since both columns have the same number of characters,
and the righthand-side is a lot easier to understand:

	print STDOUT "Hi";	print $STDOUT "Hi";
	foo(\*STDOUT);		foo($STDOUT);

Scalars hold references to objects.  Filehandles should, ultimately, 
be objects, as should directory handles.

Just my 10 centimes,

Eryq

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About