-----Original Message-----
> From: Aglipay, Recelyn [mailto:[email protected]]
> Sent: Wednesday, March 11, 2009 15:35
> To: [email protected]
> Subject: Network Printing using a Perl Script
>
> Hello everyone,
>
>
>
> I'm a beginner and having some issues with a Perl Script I had written
> for work.
>
> I am trying to print to a network label printer. I've
> verified that the
> printer is working on its own.
>
> But when I try to print to it using Perl nothing happens.
>
>
>
> Here is a copy of my code. I get the message "The label was printed
> successfully" in my log but nothing ever printed.
>
>
>
> return 1;
>
>
>
> sub PRINT_LABEL
>
>
>
> {
>
> my $port = "9100";
>
> my $printer1 = "\\10.10.10.10\Zebra LP2824";
With double quotes, you are not getting waht you think. When
slashes(\) and double quotes are involved, then need to double the
slashes or use single quotes.
>
> my $directory = "D:/TEST/TDS/EdPtLabels";
>
>
>
> opendir(DIRECTORY, $directory) || die
> "Couldn't Open the
> Directory!";
>
> open(OUTPUT_PRINTER, "> $printer1\$port") ||
Again the double quotes and the \ are not doing what yiou think.
> die "Unable
> to open the printer!";
>
Either you have code missing or you think something is happening
by the opendi. At this point, you have an open directory and attempted
open output, but no where do I see you doing the printing of the
file(s).
Is there code missing or is this it?
If you have any questions and/or problems, please let me know.
Thanks.
Wags ;)
David R. Wagner
Senior Programmer Analyst
FedEx Freight
1.719.484.2097 TEL
1.719.484.2419 FAX
1.408.623.5963 Cell
http://fedex.com/us
>
>
> print LOG_FILE
> "\n--------------------------------------------------------------\n";
>
> print LOG_FILE "The label was printed successfully\n";
>
> print LOG_FILE
> "\n--------------------------------------------------------------\n";
>
>
>
> closedir (DIRECTORY);
>
> close (OUTPUT_PRINTER);
>
>
>
> }
>
>
>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/