Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7397833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:47:51+00:00 2026-05-29T03:47:51+00:00

I am using the Net::FTP in perl to do some file transfers. when I

  • 0

I am using the Net::FTP in perl to do some file transfers. when I run the following code :-

Are there any issues with using the IP address ? Am I correct in providing this in the host field ?

use strict;          
use Net::FTP;

my $host = "10.77.69.124";
my $user = "administrator";
my $password = "Password";

my $f = Net::FTP->new($host, Debug =>0) or die "Can't open $host\n";
$f->login($user, $password) or die "Can't log  $user in\n";

The code is not able to connect to the remote host. Why is this happening ? Shouldn’t this work with the IP address provided in the $host ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:47:52+00:00Added an answer on May 29, 2026 at 3:47 am

    The constructor of Net::FTP allows you to pass a single scalar value or an array of hosts to try. The value of this field should be the same as the PeerAddr from IO::Socket::INET (either a hostname or an ip address).

    Have a closer look at what is happening by specifying Debug. If you are behind a firewall or a NAT setup, you should probably also set Passive to a non-zero value and make sure to check if the constructor failed by printing out $@.

    my $ftp = Net::FTP->new(Host=>$host, Debug=>1, Passive=>1) || die $@;
    

    If the constructor succeeded, you might want to check if any of the other methods fail:

    $ftp->login($user, $pass) || die $ftp->message;
    $ftp->cwd($path) || die $ftp->message;
    

    By the way: If you are unsure if you’ve used the correct host parameter, you can ask Net::FTP which host it tried to connect to:

    print $ftp->host, "\n";
    

    If this still doesn’t work, please provide a detailed output of your application.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using the following Apache Commons Net FTP code to connect to an
I am getting following exception while ftp file over to some other machine. org.apache.commons.net.io.CopyStreamException:
I tried file system publish and ftp I'm using VS2010 and .net 4.0 should
I am uploading files from local to FTP using perl Net::FTP Module. After uploading
I'm using Net::FTP to put a file on a remote server. I need to
I have code to upload a file to a server. import org.apache.commons.net.ftp.FTPClient; import java.io.File;
I used following code for downloading XML file from ftp to android phone memory
I am uploading the folder from local to FTP using perl Net::FTP::Recursive module. I
I'm trying to upload large file (>100Mb) using Apache commons-net FTP library to Secure
I wrote multi-threaded FTP uploader on C#.NET using libcurl.NET. Everything works fine on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.