#!/usr/bin/perl -w use DBI; use Net::Telnet (); $t = new Net::Telnet (Timeout => 10,); $user = "admin"; $passwd = ""; $t->open("Sparta"); $t->login($user, $passwd); @lines = $t->cmd("switchshow"); # Connect to the database. my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost", "joe", "joe's password", {'RaiseError' => 1}); $dbh->do("INSERT INTO foo VALUES (1, " . $dbh->quote("Tim") . ")");