AnyEvent-ReadLine-Gnu

 view release on metacpan or  search on metacpan

bin/rltelnet  view on Meta::CPAN

#!/opt/bin/perl

use AnyEvent;
use AnyEvent::Socket;
use AnyEvent::ReadLine::Gnu;

@ARGV >= 1
   or die "Usage: $0 host:port (e.g. 127.0.0.1:8888 or unix/:/tmp/aedebug)\n";

my ($host, $service) = parse_hostport $ARGV[0], $ARGV[1]
   or die "$ARGV[0]: unable to parse destination address and port\n";

my ($fh, $peerhost, $peerport) = do {
      tcp_connect $host, $service, my $cv = AE::cv;
      $cv->recv
   }
   or die "$host:$service $!\n";

bin/rltelnet  view on Meta::CPAN

__END__

=head1 NAME

   rltelnet - connect to a socket with readline frontend

=head1 SYNOPSIS

   rltelnet www.nethype,de:80
   rltelnet www.google.com 80
   rltelnet unix/ /path/to/socket

=head1 DESCRIPTION

This program connects to a socket using AnyEvent::Socket::tcp_connect, prints
everything it receives from the socket and offers a readline editing interface
to send lines to the socket.

This is very remotely what telnet does when used on a non-telnet socket,
except that it uses readline and supports more types of socketsd (e.g.
unix domain sockets).

=head1 AUTHOR, CONTACT, SUPPORT

 Marc Lehmann <schmorp@schmorp.de>
 http://software.schmorp.de/pkg/AnyEvent-ReadLine-Gnu.html

=cut



( run in 1.574 second using v1.01-cache-2.11-cpan-39bf76dae61 )