my $ssh = Net::SSH::Perl->new($server); $ssh->login('#######','#######') || die "Cannot connect to Server"; my $dir = "/data/log/"; $ssh->cmd("cd $dir") || warn "Cannot change to directory $dir $!"; print $ssh->cmd('pwd');