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

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

I need to print to a printer from a perl script running on ActivePerl on a Win98 system. chromatic said here that on a UNIX system it was enough to "open a pipe to lpr". Can I also do that on WIndows? If so, how do you "open a pipe to lpr"? If not, do you know of any module that I can use that would allow me to do that?

Thanx.

Zenon Zabinski | zdog | zdog7@hotmail.com

Replies are listed 'Best First'.
Re: Printing to a Win98 Printer (Win32, Win32API)
by ybiC (Prior) on Jul 28, 2000 at 01:31 UTC
Re: Printing to a Printer (Win98)
by tye (Sage) on Jul 28, 2000 at 07:29 UTC

    One of:

    open(PRINTER,">prn") or die "Can't write to aux: $!\n"; open(PRINTER,">lpt1") or die "Can't write to lpt1: $!\n";

    should let you write text to be printed. But I know almost nothing about this.

      Thanks a lot. It gets the job done to a certain extent, but it still needs to have a few kinks worked out. But it gives me a great start, thanks.

      Zenon Zabinski | zdog | zdog7@hotmail.com