I was thinking about default filehandles yesterday. select() doesn't
seem to be around except as an "Unfiled" function in S16. 

Then, as I was looking at 

   .say( "Hello World" );


   $ERR.say( "Hello standard error" );

I figured this might work, and does. Topicalizing a filehandle kinda
acts almost like a default filehandle:

   $_ = $*ERR;
   .say( "Hello standard error" );

But, of course, that won't work for say() used as a function:

   say "Hello standard error" ;

Then, I thought I might assign to $*OUT, which doesn't work in pugs
(and I might have missed the part of the spec that says these are

   my $saved_standard = $*OUT;
   $*OUT = $*ERR;   # this is an error

   say "This goes to stderr";   # not until previous line works   
   say $saved_standard: "This goes to stdout";  # just fine

Is there going to be a Perl 6 feature for this?

Reply via email to