in reply to Net::FTP cd vs cwd


A small code to change the directory, display messages and output the current working directory.
use strict; use Net::FTP; my ($ftp, $ftpmessage, $fullpath); { $ftp = Net::FTP->new(<ftphost>) or die "Error: $!"; $ftp->login(<ftpuser>, <ftppass>) or die "Login Failure: $!"; $ftp->binary(); $ftp->cwd("$directory") or die "Couldn't change directory. $!"; $ftpmessage=$ftp->message(); $fullpath=$ftp->pwd(); print "Fullpathname $fullpath\n"; }

Rupesh.

Replies are listed 'Best First'.
Re^2: Net::FTP cd vs cwd
by qadwjoh (Scribe) on Sep 20, 2004 at 13:12 UTC
    Thanks for the help - I hadn't noticed the "message" method before.

    I got my code working - the "cwd" was in fact successful (as revealed by a $ftp_con->message, and the problem lay elsewhere with a splice.

    Thanks,
    A