<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Funny you should mention that.  I agree
      completely, and the whitespace for defining call syntax makes a
      lot of sense to me.  <br>
      <br>
      In fact, that was what I was expecting and I was quite surprised
      when Perl interpreted it as part of the print.  Loved the %%
      operator by the way, seems like when I'm using modulus, that's the
      purpose 9 times out of 10 (on the other hand usurping bitwise
      & for anything else is a horrible abuse of long-time
      programmers trust; can't believe perl6 went there)<br>
      <br>
      <div class="moz-signature">Robert Flach<br>
        <b>Web Tools</b><br>
      </div>
      On 9/11/2014 3:05 PM, Patrick R. Michaud wrote:<br>
    </div>
    <blockquote cite="mid:20140911200503.GB18564@pmichaud.com"
      type="cite">
      <pre wrap="">On Thu, Sep 11, 2014 at 02:42:16PM -0500, Robert Flach wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Yet another way to do it. Interesting.  I would have assumed that
the unary + would have caused a numeric contextual evaluation of the
contents of the parens, causing the string prints to print zero
instead, but it works a charm.  Nice
</pre>
      </blockquote>
      <pre wrap="">
Coming from the Perl 6 world, it feels SO WRONG to me that a
numeric context operator isn't producing a numeric result.  It's
one of those "OMG special case" exceptions that drive newbie 
Perl 5 programmers nuts, and definitely doesn't follow the 
principle of least astonishment.

So yes, it works, but it's not something I'd encourage or want to
see in code.  :)

FWIW, Perl 6 avoids this altogether by using whitespace to know
when parens are part of the subroutine call syntax:

    print(2+3) * 7         # parens belong to "print" call
    print (2+3) * 7        # parens don't belong to the "print" call

Pm
_______________________________________________
Dfw-pm mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dfw-pm@pm.org">Dfw-pm@pm.org</a>
<a class="moz-txt-link-freetext" href="http://mail.pm.org/mailman/listinfo/dfw-pm">http://mail.pm.org/mailman/listinfo/dfw-pm</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>