On Fri, Dec 11, 2009 at 12:44:21PM -0800, yary wrote:
: What's the reasoning behind not using older perl convention of print
: w/no args becoming "print $_" ?

In Perl 6 we're trying to get rid of all the arbitrary lists that you
have to memorize to use Perl 5, such as which symbols are magically
global everywhere, or which blocks require semicolons at the end.
One of those arbitrary lists is which functions do/don't default to $_.
Quick, does rand() default to $_ in Perl 5?  (I don't remember...)

On the other side, with the method call syntax changing from ->
to dot we have the ability to indicate use of $_ explicitly with a
single character:

    for @list { .print }

So the only remaining issue is making sure people don't use the old
form by accident and silently get the wrong output.  Hence the warning,
emitted by STD now as:

    Potential difficulties:
       Unsupported use of bare 'print'; in Perl 6 please use .print if you want 
to print $_, or use an explicit argument at (eval) line 1:
    ------> for @list { printā }


Reply via email to