Hi,

I am struggling with a mysterious problem sending data to (HP jetdirect) 
printers;
The printers accepts postscript/pcl data on port 9100. Sending the data with:
   cat data.ps | netcat printer 9100
always works. When sending the data with a Perl program however, in some cases
the printers for some reason won't print. I reduced the problem to a tiny test
program that basically looks like this:

my $out=IO::Socket::INET->new("$ip:$port") or die;
my $bs=1024;
my ($num_read,$buf);
while ($num_read= $in->read($buf,$bs)) {
    $out->print($buf) or die;
}
close $out;

In those cases where the problem occurs (It's pretty esoteric because it only
affects newer printers and certain data; PCL and everything ghostscript creates
always work; pretty much everything the Windows XP postscript driver generates
fails ...) the program still runs without any visible problem, the printer 
signals
that it is busy but seems to just discard the data.

The same data sent with netcat, however will always be printed.
Does anybody have any idea what the essential difference between my little test
program and sending the data with netcat might be? I already tried different
variations I could think of (buffer sizes, autoflush, syswrite instead of print,
delays ...) but so far I couldn't find anything that makes a difference.

Does anybody have an idea? Any hints are welcome!

Regards,
                  Peter Daum


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