> 
> On Wed, 23 Mar 2005 16:05:53 -0500, Brian Volk wrote:
> > Hi All,
> > 
> > I'm trying to send the output file to a network printer.  
> The program is
> > working fine as far as producing the file, but it is not 
> being sent to the
> > printer.  Can someone pls take a look at my program and see 
> if everything
> > looks Okay.  It may just be the path to the printer, not 
> sure.   Thanks in
> > advance!
> > 
> >                  copy ($source_file, '//HP-EXCH/HP LaserJet 
> 4100(IS)');
> 
> What makes you think that File::Copy's "copy" supports printing
> directly to a printer this way? According to "perldoc File::Copy", if
> the argument is a string, it is assumed to be the name of a file. This
> is not the case here, so I doubt this will work...
> 
> I suggest either using the Net::Printer module
> (http://search.cpan.org/dist/Net-Printer/) or manually opening a
> filehandle to an "lp" process and providing that filehandle as the
> argument to "copy".
> 
> Hope this helps,
> -- 
> Offer Kaye


Thank you for the response, I will look into using Net::Printer.

To answer your question.  "What makes you think that File::Copy's "copy"
supports printing
directly to a printer this way?"  I was google'ing and found this....

---------------- Google "perlmonks.thepen.com/158993.html"
-------------------
Answer: How do I send a file to the printer on Win32? contributed by munchie
It's very easy, as I recently discovered.

use File::Copy;

copy($file,'lpt1:');


 
Answer: How do I send a file to the printer on Win32? contributed by
Anonymous Monk
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');
----------------------------------------------------------------------------
--

Thanks!

Brian Volk 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to