#!/usr/bin/perl -w #DatenbankAbfragen use strict; use warnings; use DBI; use Net::Telnet::Cisco; our $dbh; my $session = Net::Telnet::Cisco-> new (Host  => '10.200.2.105'); While('R-id','Name','ip','pwd'){ sub get Router{ my $name=shift; my $ip=shift; my $user=shift; my $pwd=shift; my ($query,$sth,$sth1,$execu,$newdata,$ds,$summe); $query = "UPDATE GATE_STATE SET STATE.Time=NOW() WHERE STATE.Name='$name' ORDER BY STATE.Time DESC LIMIT 1";          $sth1=$dbh->prepare($query) or die "Querry Error prepare: $DBI::errstr\n";          $sth1->execute or die "Querry Error execute: $DBI::errstr\n";          $sth->finish(); } }