http://www.perlmonks.org?node_id=384423

schweini has asked for the wisdom of the Perl Monks concerning the following question:

hi, all.

anybody know how to make windows print raw-text via the spooler instead of using the cludgy open(PRN, "> COM1")?
this "open" method is a PITA since it doesn't keep track of printer-buffers, whether the printer is switched on, etc.
a quick search turned up some nodes, but no real solution like open(PRN, "|lpr") on unix.
thanks,

-schweini

Replies are listed 'Best First'.
Re: printing to a spooler under windows
by gellyfish (Monsignor) on Aug 20, 2004 at 09:12 UTC

    One solution is to create and share a printer on the appropriate windows machine and then open it with:

    open PRINTER ,'>\\\\machinename\\printername' or die "No printer :$!\n";
    This should use the print service on the machine that the share is setup on.

    /J\

Re: printing to a spooler under windows
by ikegami (Patriarch) on Aug 19, 2004 at 22:07 UTC
    If you can find what API call to use, you can use Win32::API to call it
Re: printing to a spooler under windows
by PodMaster (Abbot) on Aug 20, 2004 at 03:40 UTC
    Try Printer maybe?

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.