Ah, guess we we're talking about the same thing... I got confused when you said:
I can see that scanfile will see that it was called with "wantarray" But why does print think that's an indirect object...
But scanfile doesn't get treated as a subroutine at all, so I didn't understand where wantarrray comes in to play. See the second stanza below for what I thought you meant by indirect object...

I don't have an answer for you, but I have yet to find a print statement that Deparses differently depending on the outer parens. I think it might be a red herring, which is why I left them off in my previous example.

% perl -MO=Deparse -e 'print abc' print abc $_; % perl -MO=Deparse -e 'print(abc)' print abc $_; # when you said 'indirect object' I thought this was # what you thought was going on.... % perl -MO=Deparse -e 'print abc def' print 'def'->abc; % perl -MO=Deparse -e 'print(abc def)' print 'def'->abc; % perl -MO=Deparse -e 'open abc; print abc def' open abc; print abc 'def'; % perl -MO=Deparse -e 'open abc; print(abc def)' open abc; print abc 'def'; % perl -MO=Deparse -e 'print abc:: def' print abc 'def'; % perl -MO=Deparse -e 'print(abc:: def)' print abc 'def'; % perl -MO=Deparse -e 'print abc:: ()' print abc (); % perl -MO=Deparse -e 'print(abc:: ())' print abc (); % perl -MO=Deparse -e 'print abc::def ()' print abc::def (); % perl -MO=Deparse -e 'print(abc::def ())' print abc::def ();

-Blake


In reply to Re: Re: Re: Re: (jeffa) Re: 'print' puzzle by blakem
in thread 'print' puzzle by John M. Dlugosz

Title:
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, details, 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, summary, 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.