i tried the following but to no avail,
it executed OK - ie no errors - but i did not get any output on the printer
??
Darren.


#!/usr/bin/perl -w
use IO::Socket;
$socket = IO::Socket::INET->new(PeerAddr => "10.3.99.113",
                                PeerPort => "2006",
                                Proto    => "tcp",
                                Type     => SOCK_STREAM)
    or die "cant connect .....\n";
print $socket "hello there\n";
close ($socket);

-------------------------------------------------------

----- Original Message -----
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 22, 2001 11:15 PM
Subject: RE: Module to assist in printing to a dumb printer on a network


> -----Original Message-----
> From: Darren Edgerton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 22, 2001 6:43 AM
> To: [EMAIL PROTECTED]
> Subject: Module to assist in printing to a dumb printer on a network
>
>
> Hi,
>
> i was wondering if there was perl module that would allow me to
> print to a serial printer that is attached to a cisco router
>
> Situation:
> i have a cisco router cs2511 which has 16 serial ports
> port 1 has a serial printer attached
>
> from my host i can telnet to the router and specify tcp port  2001
> ie  telnet a.b.c.d 2001
>
> anything i type will print on the printer
>
>
> what i want to be able to do is issue a command like:
>         some_command  a.b.c.d 2001 some_file_to_print
>
> which will then send the print job to the printer.
>
> Can anybody point me in the right direction.

Sounds like you just need a simple TCP connection. Use the IO::Socket::INET
module for that (part of standard perl dist).

If you truly need telnet protocol (I doubt that you do), use Net::Telnet
(available on CPAN, part of Bundle::libnet I think)

See also perldoc perlipc

Buy the Perl Cookbook (the Ram book) for some nice simple examples to get
you started.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to