in reply to Trapping errors from NET::Ftp

Looking at the Net::FTP code (try it, you'll like it!) it looks like the get() method returns the name of the local file name if successful, undef if not. Try something like this:
my $localname = $ftp->get("$path$station.TXT", "$datapath$station.TXT" +); die "Something went wrong" unless defined $localname; $ftp->quit;
You may want more robust error handling, but I just tested that and it works.

Replies are listed 'Best First'.
RE: Re: Trapping errors from NET::Ftp
by Anonymous Monk on May 23, 2000 at 02:21 UTC
    Net::ftp does not seem to exist on CPAN. What am I missing? sG

      I believe Net::Ftp comes with libnet. Check here for more info.

      72656B636148206C72655020726568746F6E41207473754A

      When the sun set on today, the sun is preparing tomorows beauty. here is the page from CPAN concerning NET::FTP (which im having probs with, looking through perlmonks for the 1rst time) http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?new=Search;join=and;arrange=file;download=auto;stem=no;case=clike;site=ftp.funet.fi;age=;filetype=%20module%20name;modinfo=5295