Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
February 27, 2006, 8:44 am
rate this thread
Re: Net::Telnet => Will cd ( change directory ) command work ?
Vinod k wrote:
Hm, should be possible. You could do something like this to trap
whether an error occurred since cd wouldn't output anything if
my $telnet = Net::Telnet->new( ... );
$telnet->cmd_remove_mode(1); # omit command echo from output
my @output = $telnet->cmd('cd /path/to/somewhere')
die "cd error: @output\n" if @output;
If on my Unix system I try to cd to a directory without having privilege
to do so, the above dies with:
ksh: /path/to/somewhere: permission denied
There may be a more general way....
- » Namespace Recommendation for Abuse Reporting Utilities Module
- — Previous thread in » PERL Modules Announcements