in reply to Printing a strange 1 on page.

Please consult How to return the exit status thru perl script execution?