in reply to NET::Printer Module not printing to local printer

Net::Printer opens a socket connection to the print server/printer. Does your webserver allow that??? (EDIT: obviously it does because you got something printed out but perhaps the connection is killed?)

Net::Printer's documentation does not mention the debug option to new(). Add debug => 'Yes' to new Net::Printer() and see if any messages can help you.

I would also move print "Content-Type:text/html\n\n"; before creating the printer object. I was bitten by printing to std* before printing content-type many times. Move it as far up as it can go.

Also, I would convert the cgi script you posted to a normal command-line perl script and use that to test (rather than testing with lp ...).

Replacing Net::Printer with running a system command from a cgi script could become a problem. Because the webserver can be configured not to allow that, at some point in the future. Or to run it on very low priority. Additionally, there are the usual huge security risks that come with allowing a web service taking user input to shell out. The usual response of course being "we are all friends in our intranet". And I stop here.

bw, bliako