"Chas Owens" schreef:

> But Synopsis 4* says
>        There is no foreach statement any more. It's always spelled for
> in Perl 6,
>        so it always takes a list as an argument

Well Perl6 isn't Perl, it's a successor to Perl. Like Perl did, Perl6
took a lot of good parts out of other languages (like Perl, Haskell,
Java, etc.) to become the rather perfect language it now is.
Perl6 has far more syntactical synonymity than any language I know. For
example a Perl6Tidy could present your (or someone else's) Perl6 code in
many different verbosities, far beyond all the different ways that

  s~^\s+~~, s~\s+$~~ for $text;

could be rewritten into.


$ perl -MO=Deparse -e's#^\s+##, s#\s+$## for $s'
;
foreach $_ ($s) {
    s/^\s+//, s/\s+$//;
}
-e syntax OK


-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to