Aglipay, Recelyn wrote:
Hello everyone,

Hello,

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";
my $directory = "D:/TEST/TDS/EdPtLabels";
                opendir(DIRECTORY, $directory) || die "Couldn't Open the
Directory!"; open(OUTPUT_PRINTER, "> $printer1\$port") || die "Unable
to open the printer!";

                print LOG_FILE
"\n--------------------------------------------------------------\n";
                print LOG_FILE "The label was printed successfully\n";
                print LOG_FILE
"\n--------------------------------------------------------------\n";

closedir (DIRECTORY); close (OUTPUT_PRINTER);
}

You are not printing anything to the OUTPUT_PRINTER filehandle.


John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to