#!/usr/bin/perl -w use Net::Telnet @files = disks, readdir(MDIR)); $t = new Net::Telnet(Timeout => 2810, Prompt => '/%/', Host => 'hostname' ); $t->login( "username", "password" ); foreach $x ( @files ) { $t->cmd( "run command here/$x" );