in reply to CGI throws in an extra character. Why?

The print #query->end_html; at the end, I think. print is sucking up the true return value of the closedir because the end_html is commented out.

Replies are listed 'Best First'.
Re^2: CGI throws in an extra character. Why?
by Petras (Friar) on Dec 01, 2004 at 20:07 UTC
    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

      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.