Re: RFC 30 (v2) STDIN, STDOUT, and STDERR should be renamed
[email protected] (Graham Barr) Wed, 16 Aug 2000 22:30:57 +0100
| Newsgroups | perl.perl6.language.io |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 16, 2000 at 08:27:04PM +0000, Nick Ing-Simmons wrote: > Perl6 Rfc Librarian <[email protected]> writes: > > > >In addition, this RFC recommends deprecating select(), since it is no > >longer needed with the new fileobject approach described in RFC 14. > > > > > > $oldoutput = select($newoutput); > > > >Can now be written simply as reassignments: > > > > $oldoutput = $STDOUT; > > $STDOUT = $filehandle; > > But that is _NOT_ what select() does: > > $olddef = select($newdef); > print $STDOUT "Still goes to $STDOUT"; > print "This goes to $newdef"; > > select sets the default for a print with no handle specified it does NOT > change STDOUT. > > It will be impossible to translate many perl5 programs to perl6 if > that difference is not retained somehow. Create a new handle, like $DEFOUT. Then there would be no need for selectsaver either as you would do the equiv. of local($DEFOUT) = $newhandle; Graham.