Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about Net::FTP Bad protocol 'tcp'

Status
Not open for further replies.

ilackic

Technical User
Sep 19, 2006
1
HR
Hi!
I have tried to use FTP from Perl, and found out that all the sample programs found on the Internet don't work. Further investigation showed that there is following error

"Cannot connect to host: Net::FTP: Bad protocol 'tcp' at ftptest1.pl line 4."

The part of the perl script that caused this error is:

1.#!/usr/bin/perl -w
2. use Net::FTP;
3.
4. $ftp = Net::FTP->new("Host", Debug => 0)
5. or die "Cannot connect to host: $@";

I use Windows XP SP2 and ActiveState Perl 5.8.7. Can anybody help with this? The FTP server on machine "host" is up and running, using command line I can FTP without problem.
 
Here is what I have:
$ftpHandle = Net::FTP->new($serverIP,Debug=> -1,Passive => 1) || die &errhandler ("Bad server: $!");

However this is all on one line. I see you have line 4 and 5. Should it be on one line?

Just a guess...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top