No announcement yet.

Very basic PERL FTP question

  • Filter
  • Time
  • Show
Clear All
new posts

  • Very basic PERL FTP question

    I'm just trying to use FTP in Perl, so I have copied the following from a perl FTP tutorial:

    use strict;
    use warnings;
    use Net::FTP;
    my ($ftp, $host, $user, $pass, $dir, $fpath);
    $host = "";
    $user = "myuser";
    $pass = "mypassword";
    $fpath = "myfile.csv";
    $ftp = Net::FTP->new($host, Debug => 0);
    $ftp->login($user, $pass) || die $ftp->message;
    $ftp->get($fpath) || die $ftp->message;
    So my question is - where is the file now...? I mean, it's logged in to the FTP server and has downloaded the file from the FTP site - but to which variable?? Or to put it another way, if I wanted to display the file on the screen how would I do that...?

    I'm just learning perl, so sorry if that's a stupid question.

  • #2
    Well, you are using "get" so I suspect the file is on your local hard drive.
    Have a Script or Snippet you want to share?

    WWW Standards: HTML 4.01,
    HTML 5, CSS2.1, CSS3, XHTML 1.0
    PHP Standards: PHP Standards