shadowbiz has asked for the wisdom of the Perl Monks concerning the following question:
Here is a sample output of what I am getting.sub main { my($devicename, $ip, $mask, $ts); my($line, @modem, $result_line); open(DEVICELIST, "<Devicelist") or die "Can't open Devicelist file : $ +!\n"; while ($line = <DEVICELIST>) { $devicename = $line; chomp($devicename); # login to the device $ts=loginDevice("username", "passwd", "enpasswd", $devicename) +; open(OUTFILE, ">>Device-info") || die("Cannot open Device-info: $!\n"); print OUTFILE "Device $devicename\n"; @modem = $ts->cmd("show run | inc dhcp relay"); foreach $result_line (@modem) { print OUTFILE "$result_line\n"; } print OUTFILE "\n"; close(OUTFILE); $ts->print('exit'); } exit; }
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unwanted extra text appearing in array
by Muoyo (Novice) on Jun 13, 2003 at 19:03 UTC | |
|
Re: Unwanted extra text appearing in array
by fglock (Vicar) on Jun 13, 2003 at 17:24 UTC | |
|
Re: Unwanted extra text appearing in array
by chip (Curate) on Jun 13, 2003 at 18:10 UTC | |
by allolex (Curate) on Jun 14, 2003 at 07:08 UTC | |
|
Re: Unwanted extra text appearing in array
by chip (Curate) on Jun 13, 2003 at 16:18 UTC | |
by shadowbiz (Acolyte) on Jun 13, 2003 at 16:26 UTC | |
by Rex(Wrecks) (Curate) on Jun 13, 2003 at 19:05 UTC |