timmyb85 has asked for the wisdom of the Perl Monks concerning the following question:

How do I print to a printer using mconnect? I tried all of the following for the starting line:

open (MPRINT, "|$mconn |$ipconnect") || die "Can't open $mconn!\n";
open (MPRINT, "|-") || exec '$mconn' || die "Can't open pipe to $mconn!";
open (MPRINT, "$mconn|") or die $!;
$mconn is "mconnect 123.456.78.90 -p 1234"

The only one that works is:

open (MPRINT, "|$mconn") or die $!;

It prints, but I get an error on my computer, so it is worthless...I don't know what the error is, and I don't know how to find out what the error is. I don't know why I get the error...I'm not printing anything into the pipe at that point. I've closed the open statement...I don't know what is wrong.

I have just started learning Perl for the first time this week, and am hoping that somebody can just give me a line of code that will print using mconnect and not give an error. Thank You! :)

Replies are listed 'Best First'.
Re: Printing with mconnect
by derby (Abbot) on Apr 01, 2004 at 23:36 UTC
    Sorry. I can't help you with mconnect. If that's the mail connect program, I would suggest you just use Net::SMTP.

    -derby