Re: [MacPerl-WebCGI] perl and printing on a printer

[email protected] (Bill Becker) Mon, 6 Jan 2003 15:09:40 -0800
Newsgroups perl.macperl.webcgi
Message-ID <p05111600ba3fbb8e8ab5@[66.81.122.224]>
At 21:39 +0100 01/06/2003, Eelco Alosery wrote:
>Hy,

Howdy.

>
>I'm using macosx 10.2.3 and I run my own webserver.
>Now I have a contact form whitch send's me the input to a e-mail 
>adres, but is it posible to print the input directly on my HP 
>ColorLaserJet 2500.
>I want to do it whith a cgi program, anny help is verry welcom.
>

Since you are running a Unix system, it would be quite easy to set up 
a background print task/process (with Perl?) that "listens" on a 
socket/port and does nothing but take the cgi-bin's output from a 
write, then send it to the printer.

Alternatively, you could let the cgi-bin application write a file to 
a special directory and have a different form of background process 
periodically wake up and look for any new entries in the directory. 
If anything is found, then it would read, print, and remove each file 
as it's printed...

Like the book says, "There's more than one way to do it."