Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I was puzzled by this one too ...

[me@ptmr]/home/me$ perl -le 'print -2 ** 4 ' # ** binds before - -16 [me@ptmr]/home/me$ perl -le 'print (-2) ** 4 ' # this puzzled me -2 [me@ptmr]/home/me$ perl -le 'print ((-2) ** 4)' # parenthesis force wh +at I want 16

but I guess print is handling the second case as a list followed by some irrelevance, do I have that about right ?

Update: Thanks Fletch now I have been enlightened! I last read perlfunc a long time ago and had not really absorbed it all at the time. Now I see the explanation print (something) something_else gives the warning print (...) interpreted as function because it looks like a function.


Pereant, qui ante nos nostra dixerunt!

In reply to Re^2: ** operator in perl by Random_Walk
in thread ** operator in perl by irah

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    LanX Most entertaining ...
    LanX ... like a cross over of Yes, Minister with House Of Cards ... just cheaper actors.

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (10)
    As of 2017-10-23 10:39 GMT
    Find Nodes?
      Voting Booth?
      My fridge is mostly full of:

      Results (279 votes). Check out past polls.