http://www.perlmonks.org?node_id=411548


in reply to Re: CGI throws in an extra character. Why?
in thread CGI throws in an extra character. Why?

Just curious, then. I really don't know how to check, so I'll just ask (ah, ignorance and laziness....). Does  closedir execute if it is part of a  print statement? print ++$someVar; would execute the incriment even though it is part of a print statement. Are there any rules as to what executes as part of another statement and what doesn't?

Thanks,
-P

Replies are listed 'Best First'.
Re^3: CGI throws in an extra character. Why?
by Your Mother (Archbishop) on Dec 02, 2004 at 03:52 UTC

    I'm not a guru and I hope I don't misspeak but here's an offering: print is a list operator so it's always going to wait for everything to its right, w/i its precedence space, to finish. Perl is really great for its DWIMness in the sense that statements/subs/methods often act the way you'd expect or hope just from looking at them. The rules for that stuff is mostly just precedence (how strongly an operator or function wants to grab and act upon what's around it).

    Check out perlop for precedence info in all its gl?ory.