> >The rule is easier ("print always goes to $STDOUT, whatever that
> >contains") and there's not select() overhead. Everything else should be
> >object methods, making stuff clearer still.
> 
> And it is also a pain in the butt.
> 
>   select *LOG;
>   do_stuff();
> 
>   sub do_stuff {
>      print "this stuff goes somewhere\n";
>      print STDOUT "we printed stuff somewhere\n";
>   }

Good point, I hadn't thought of this specific situation. select() can
stay. :-) Note, though, that you still wouldn't have to pass a
filehandle to do_stuff() without select. You just wouldn't be able to
intermingle $STDOUT and $LOG easily.

To summarize, RFCs 14, 30, and 33 taken together say the above will be
written as:

   $LOG = open ">>/path/to/log";
   select $LOG;
   do_stuff();

   sub do_stuff {
       print "this stuff goes somewhere\n";
       print $STDOUT "we printed stuff to somewhere\n";
   }

in Perl 6. Not a huge change, just that bareword filehandles and
typeglobs are getting replaced with full-featured fileobjects.

v3 will take the part about select() out.

-Nate

Reply via email to