I shared my default printer and opened the printer as \\computer_Name\Printer_name. Creating the share solved the problem...
Thanks for you assistance. Ronald G. Nichols Director of Information Technology Knouse Foods Cooperative, Inc. [EMAIL PROTECTED] (717) 677-8181 Ext. 3470 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Cornetet Sent: Friday, July 28, 2006 12:38 PM To: Perl-Win32-Users@listserv.ActiveState.com Subject: RE: Printing to Network Printer Open the printer share name. For example, if the computer that the printer is set up on is called "chworktap", and the printer share name is "wagstaff", then your open should look like this: Open FILE, "\\\\chworktap\\wagstaff" Your post mentions an IP address and port 9100 (typically used by network print servers for raw data). If you want to send data directly to the printer over the network, you'd have to open a socket to the destination IP address and port and dump the data which will transparently be sent to the printer. That's the theory - I've never tried it. If you really want to send data directly to the printer, and if the print server will handle the LPR protocol, your best bet would probably be Net::LPR. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nichols, Ron Sent: Friday, July 28, 2006 8:22 AM To: Perl-Win32-Users@listserv.ActiveState.com Subject: Printing to Network Printer I have a PERL script that prints to a network printer on a Windows XP Professional OS. The script will be used on a variety of XP systems with varying network printers as the default printer. When I run the code shown below: #! perl -w use strict; my $port='9100'; my $default_printer='10.1.5.211'; open(OUTPUT_PRINTER,">\\\\$default_printer\\$port") || die "Unable to open printer: $!\n"; print OUTPUT_PRINTER "This is a test Line\n"; I get the message: Unable to open printer: Permission denied I have turned off the firewall to see if that was causing the error but get the same response. I am hoping that someone has some ideas on how to accomplish printing to the default printer. Your assistance is appreciated. Ronald G. Nichols Director of Information Technology Knouse Foods Cooperative, Inc. [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> (717) 677-8181 Ext. 3470 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs