Re: Net::FTP::Recursive;
[email protected] ("James D. White") Tue, 18 May 2004 13:21:15 -0500
| Newsgroups | perl.libnet |
|---|---|
| Organization | University of Oklahoma |
| Message-ID | <[email protected]> |
Just a guess, because I have used only Net::FTP, not
Net::FTP::Recursive, but is line 25
"$ftp->quit if $newerr;"? How can you quit, if you did not connect? If
$ftp is false it cannot
be a valid object reference.
PerlDiscuss - Perl Newsgroups and mailing lists wrote:
>I am using the Recursive Lib to copy directories from one location to
>another. However, I would like to verify that I was able to make a
>successful connection to the server by the following code. If the
>connection fails, it goes to a subroutine that prints out the errors. This
>error handling successful for all the other routines, like logging in,
>cwd, or rput. However, when I test the connection piece, i get the
>following error message.
>
>"Can't bless non-reference value at
>/usr/local/lib/perl5/site_perl/5.6.1/Net/FTP/Recursive.pm line 25."
>
>
>The following is the code:
>$ftp = Net::FTP::Recursive->new($host, Timeout=>60) or $newerr=1;
> push @ERRORS, "Can't login to server: $host: $!\n" if $newerr;
> $ftp->quit if $newerr;
> myerr() if $newerr;
> print "Connected to $host\n";
>
>sub myerr {
> print "Error!!: \n";
> print @ERRORS;
> exit 1;
>}
>
>
>
--
James D. White ([email protected])
Assistant Director, Advanced Center for Genome Technology
University of Oklahoma
101 David L. Boren Blvd., SRTC 2100
Norman, OK 73019
Phone: (405) 325-4912, FAX: (405) 325-7762