🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #72185

perl zmienna przekazana

#72185
From: ziolko
Date: Wed, 13 Apr 2011 18:34
31 lines
1602 bytes
Witam.

potrzebuje dopisać mały skrypt w perlu

Na podstawie netu ( ja sie nie znam na perlu) stworzyłem cos takiego:

-
#!/usr/bin/perl
  use warnings;
  use Net::Telnet;

  $telnet = new Net::Telnet ( Timeout=>40,
                             Errmode=>'die');

  print "$ip_\n";
  $telnet->open($ip_);
  $telnet->waitfor('/Login:/i');
  $telnet->print($login);
  $telnet->waitfor('/Password:/i');
  $telnet->print($haslo);
  $output = $telnet->waitfor('/# /i');
  print $telnet->cmd('show port 1');
  print $telnet->cmd('show port 2');
  sleep 1;
# dotad  jest dobrze ....

#mam problem jak przekazać wartosc portu do telnetu??

  for ($n = 3; $n<= 48; $n++){
  print $telnet->cmd('show port $n \n');
  }
Technical Details
Message-ID: <io4qco$oht$1@news.net.icm.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!not-for-mail
From: ziolko <ziolek70@interia.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: perl zmienna przekazana
Date: Wed, 13 Apr 2011 20:34:52 +0200
Organization: Dzial Sieciowy ICM, Uniwersytet Warszawski
Lines: 32
Message-ID: <io4qco$oht$1@news.net.icm.edu.pl>
NNTP-Posting-Host: h-244-138.elektron.com.pl
Mime-Version: 1.0
X-Trace: news.net.icm.edu.pl 1302719705 25149 85.255.244.138 (13 Apr 2011 18:35:05 GMT)
X-Complaints-To: usenet@news.net.icm.edu.pl
NNTP-Posting-Date: Wed, 13 Apr 2011 18:35:05 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
X-Antivirus: avast! (VPS 110413-0, 2011-04-13), Outbound message
X-Antivirus-Status: Clean
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit