in reply to Unzipping files into a directory issue!

...after grabbing this file(.zip) using FTP

Maybe I'm missing something, but I don't see you actually fetching the zip file(s).  All you do is a (remote) directory listing ($ftp->dir), and then you try to unzip the listed files locally on the machine the script runs on...

Also (maybe just a typo), @dir_contents is not @dircontents.

Replies are listed 'Best First'.
Re^2: Unzipping files into a directory issue!
by Anonymous Monk on Feb 18, 2011 at 13:44 UTC
    I am fetching the file here:
    # Set up FTP connection my $ftp = Net::FTP->new( $myhost ); $ftp->login( $myuser, $mypass ) || die "Could not login to $host: $ +@"; $ftp->cwd( $ftpsourcedir ) || die "Could not cwd $ftpsourcedir: $@" +; $ftp->binary(); # Get a list of files my @dircontents = $ftp->dir, "\n" || die "Could not list $ftpsource_di +r: $@"; @dircontents = sort( @dircontents );

    Yes it was a typo for demonstrate the issue on "@dir_contents is not @dircontents.", it is actually @dircontents.
      I am fetching the file here: ...

      No, you're not :)

      $ftp->dir only retrieves the file names from the remote directory, not the files themselves.  For actually fetching the files, there's the ->get method.