using ftp from perl script

Discussion in 'Perl Misc' started by vabby, Mar 27, 2007.

  1. vabby

    vabby Guest

    Hi
    I need to use ftp from perl script. below is the script.

    #!/opt/perl-5.600/bin/perl
    use strict;

    use Carp;
    use Socket;
    use FileHandle;
    use File::Basename;
    use File::path;
    use Sybase::DBlib;
    print "FTP sequence initiated\n";

    my $host = 'destination.remoste.host.com';
    my $usr = ''user_name';
    my $pass = 'passwd';
    my $file = 'ftpfile.txt';
    `ftp -n $host >/home/apariv/perl_learning/ftp.log <<END_SCRIPT`;
    `user $usr`;
    `$pass`;
    `lcd /home/apariv/perl_learning`;
    `put $file`;
    `quit`;
    #END_SCRIPT

    the script runs fine w/o any error.ftp.log file remains empty and
    there is no file copied to the remote host. can u plz help m efind out
    the error.
    vabby, Mar 27, 2007
    #1
    1. Advertising

  2. vabby

    vabby Guest

    tx for the reply . CPAN ftp module is gr8 and has solved my problem
    vabby, Mar 27, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,765
  2. Jeff Miller
    Replies:
    0
    Views:
    463
    Jeff Miller
    Mar 26, 2009
  3. D. Buck
    Replies:
    2
    Views:
    458
    D. Buck
    Jun 29, 2004
  4. vikrant
    Replies:
    4
    Views:
    263
  5. Asaf Sinai
    Replies:
    1
    Views:
    230
    Chris Davies
    Jul 4, 2006
Loading...

Share This Page