Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: net telnet help

by meetraz (Hermit)
on Dec 15, 2004 at 22:26 UTC ( [id://415208]=note: print w/replies, xml ) Need Help??


in reply to net telnet help

Close, but I think this is what you want:

#!/usr/bin/perl -w use strict; use Net::Telnet; open (INPUT, 'disks') or die $!; my @disks = <INPUT>; close (INPUT); my $conn = new Net::Telnet(Timeout => 2810, Prompt => '/%/', Host => 'hostname' ); $conn->login( "username", "password" ); foreach my $disk ( @disks ) { chomp($disk); $conn->cmd( "run command here $disk" ); }

Replies are listed 'Best First'.
Re^2: net telnet help
by ikegami (Patriarch) on Dec 15, 2004 at 23:48 UTC
    Don't forget to chomp(@disks).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://415208]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-20 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found