returning from Net::Telnet cmd

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


i have a question regarding the usage of Net::Telnet cmd.
here is some of my code
use Net::Telnet;
$key = <STDIN>;
$dir = '/home';
my $telnet = Net::Telnet-> new
(      Timeout => 30,
my @listing = $telnet-> cmd("cd $dir;/usr/bin/grep '$key' *");
                     print "@listing\n";

here is my situation. in $dir, there are many text files, as much as
8000 files.
and i need to grep for $key in every file. sometimes i can get the
if the grep results is small. Otherwise, no results will be output if
the grep is big.
Anyway i can work around this or is there something i miss in the
code?. Is it better print to screen as the cmd executes using a while
loop? any suggestions is greatly appreciated thanks..

Site Timeline