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

munchie has asked for the wisdom of the Perl Monks concerning the following question: (files)

How do I send a file to the printer on Win32?

Originally posted as a Categorized Question.

  • Comment on How do I send a file to the printer on Win32?

Replies are listed 'Best First'.
Re: How do I send a file to the printer on Win32?
by munchie (Monk) on Apr 14, 2002 at 20:11 UTC
    It's very easy, as I recently discovered.
    use File::Copy; copy($file,'lpt1:');
Re: How do I send a file to the printer on Win32?
by Anonymous Monk on Jun 07, 2002 at 12:53 UTC
    There is also another trick to write directly to a named printer, assuming the printer is shared and using the UNC syntax:
    copy($file,'//host/printername');
      copy ($print_file, '//hp-exch/HP4100-IS'); this command is working great except I don't know how to send a "\n" to the printer. The print out only displays the first line and nothing else... Any help would be greatly appreciated. Thanks, Brian bvolk@hpproducts.com