"David L. Nicol" wrote:
> 
> I don't know how large a point of view  I represent, but I do not agree that
> all data should be decorated like scalars. 

Well, I think you might be overlooking a couple of important things
about filehandles. First, having them NOT be scalars caused many
problems:

   1. You must use globs to pass them in and out of functions

   2. You cannot assign to them easily, even when it makes sense

   3. There's no way to have them interpolated in strings into
      something potentially useful.

   4. There's no easy way to maintain them as objects without
      problematic contortions.

The only downside is:

   1. They don't standout as well anymore

But you can make up for this by just keeping them in ALLCAPS:

   $FILE = open "/etc/motd";
   print $FILE @stuff;

Plus you get all the other benefits, which really are big huge benefits,
especially when you do lots of work with filehandles.

This is not mere decoration, it is fundamentally upgrading filehandles
to first-class types - finally! While it does take a little getting used
to, type it a few times and I think you'll find it looks just as natural
- in fact more natural when you consider $STDOUT is now a true object
containing true properties. 

Historically, it has been implicitly learned that filehandles are
"different thingies", but they're not, no different than a handle to a
web doc or ftp server - which are scalars currently. This change is not
about just making handles look more scalar-ish, it's about letting
handles act and exist as first-class types.

-Nate

Reply via email to