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

At the bottom of your script, here's your problem:

print #query->end_html;

That should be...

print $query->end_html;

What's happening is that # begins a comment, which means that you're calling print with no arguments, which means it defaults to printing the contents of $_, which happen to be (in this case), the number '1'.


Dave

Replies are listed 'Best First'.
Re^2: CGI throws in an extra character. Why?
by Anonymous Monk on Dec 01, 2004 at 07:01 UTC
    you're calling print with no arguments, which means it defaults to printing the contents of $_, which happen to be (in this case), the number '1'.

    No, that's not right. Notice the ; is commented out too, so the statement does not end on that line. It's actually what Your Mother said -- the return value from closedir.

      You're right. That darn # character is still to blame though. ;)


      Dave

Re^2: CGI throws in an extra character. Why?
by Petras (Friar) on Dec 01, 2004 at 05:50 UTC
    Hey, that's right on the money. Not very profound, but right on the money. Thank you very much!
      So, using a dollar sign is right on the money? :)