use strict; use Net::FTP; my ($ftp, $ftpmessage, $fullpath); { $ftp = Net::FTP->new() or die "Error: $!"; $ftp->login(, ) 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"; }