"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

Reply via email to