develooper Front page | perl.perl6.language | Postings from May 2004

Re: C style conditional statements

Thread Previous | Thread Next
From:
Larry Wall
Date:
May 12, 2004 11:39
Subject:
Re: C style conditional statements
Message ID:
20040512183914.GA7590@wall.org
On Wed, May 12, 2004 at 08:15:36PM +0200, Juerd wrote:
: A2 says $*STDIN and $*STDOUT. Has this been changed?

It's $*IN and $*OUT.

: Also, will there no longer be the concept of a selected filehandle?

That is correct.

: I'd hate to have to specify stdin and stdout in throw away scripts.

Just because there's no longer a selected filehandle doesn't mean
you have to specify stdout.  It's still the default.  It's just no
longer the default default.  Translated Perl 5 scripts that select
the current output filehandle will need to use an explicit variable
to hold the "default".  The translator will also need to translate
idioms like

    select((select(FOO),$| = 1)[0]);

to something like:

    $FOO.autoflush = 1;

: I think I like this better:
: 
:     for <> {
:         s:g/\w+/WORD/;
:         print;
:     }

That will work fine in Perl 6.  It won't even chew up all your memory
as it would in Perl 5.

Larry

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About