#!/usr/bin/perl -w
######################################################################
# (c) Michael Schilli 1999
######################################################################

use Net::Telnet;

$host   = "localhost";                       # Rechner
$userid = "michel";                          # Kennung
$passwd = "nixgibts!";                       # Paßwort
$prompt = quotemeta('$');                    # Prompt

$telnet = Net::Telnet->new(Host    => $host,
                           Timeout => 60,    # 60 Sekunden
                           Prompt  => "/^$prompt/m");

$telnet->login($userid, $passwd);            # Einloggen

@lines = $telnet->cmd("/bin/ls -l");         # Kommando absetzen
print "@lines\n";                            # Ergebnis ausgeben

@lines = $telnet->cmd("uptime");             # Kommando absetzen
print "@lines\n";                            # Ergebnis ausgeben
