What is the best way to perform error checking on the below ftp code?
Adding a $newerr=1 in replacement of the 'die' statement and then a
final catchall to check if $newerr==1?  If that is the best way, how do
you capture/display the error message?  Instead of 'or die' can you do
'or somefunction()'?

Thanks in advance,
Scott

-----Original Message-----
From: Robert Citek [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 16, 2005 7:17 PM
To: beginners@perl.org
Subject: Net::FTP works someplaces


Anyone have any ideas why code using Net::FTP on one machine won't  
work on another?

I have this piece of code that runs on a Red Hat 9 linux machine and  
on one Mac OS/X 10.4.1.  But this same code does not run on a second  
OS/X 10.4.1 machine.  By not run I mean it waits a long time on the  
ftp->get line and then dies.  It's as though the request for the file  
has been made yet the server does not send it.  What's strange is  
that on all machines normal ftp works just fine.  Any hints on where  
and how to debug what might be the issue?

perl -e '
  use Net::FTP
  my $ftp = new Net::FTP("ftp.ncbi.nih.gov") or die;
  $ftp->login("anonymous","[EMAIL PROTECTED]") or die;
  $ftp->binary() or die;
  $ftp->cwd("genbank") or die;
  $ftp->get("gbbct1.seq.gz") or die;
'

Thanks in advance.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent



-----------------------------------------
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above. This
message may be an attorney-client communication and/or work product and
as such is privileged and confidential. If the reader of this message
is not the intended recipient or an agent responsible for delivering it
to the intended recipient, you are hereby notified that you have
received this document in error and that any review, dissemination,
distribution, or copying of this message is strictly prohibited. If you
have received this communication in error, please notify us immediately
by e-mail, and delete the original message.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to