On Wed, Mar 11, 2009 at 4:35 PM, Aglipay, Recelyn
<recelyn.agli...@ehmc.com> wrote:
> 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";
>
>                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);
>
>
>
> }
>
>
>
> Thanks,
>
> Recelyn
>
>
>
>
> CONFIDENTIALITY NOTICE: This email communication and any files attached may 
> contain private, confidential, or legally privileged information intended for 
> the sole use of the designated and/or duly authorized recipient(s). If you 
> are not the intended recipient or have received this email in error, please 
> notify the sender immediately by email and permanently delete all copies of 
> this email including all attachments without reading them. If you are the 
> intended recipient, secure the contents in a manner that conforms to all 
> applicable state and/or federal requirements related to privacy and 
> confidentiality of such information.
>

in addition to whatever others may say, it appears you are missing the
colon between your printer name and port #, such as

$printer1:$port

and lose the slash in front of $port.  i'm not sure if your
redirection will actually print to the printer but every printer
assignment i've ever seen has the printer:port format if the port is
included

joe

-- 
since this is a gmail account, please verify the mailing list is
included in the reply to addresses

--
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