in reply to ftp issue in perl

I am using the below code and it's fine for me. Try this.
use strict; use warnings; use Net::FTP; my $hostname = 'ftp.check.com'; my $username = 'check'; my $password = 'check'; # Hardcode the directory and filename to get my $home = '/ToFTP'; # Open the connection to the host my $ftp = Net::FTP->new($hostname); # construct object $ftp->login($username, $password); # log in #$ftp->cwd($home) or # die "Can't change directory ($home):" . # $ftp->message; my $pwd = $ftp->pwd; my @ls = $ftp->ls('-lR'); foreach (@ls) { print "$_\n"; } $ftp->quit;

Replies are listed 'Best First'.
Re^2: ftp issue in perl
by namishtiwari (Acolyte) on Jul 27, 2009 at 11:32 UTC
    Hi Selva, This part is fine to me, i am also not getting any error in my code when i siply ftp a file from a server. but my requirement is diffrent, i want to FTP a file and then uncompress it and select some which i want. Thanks NT