Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Cannot open local file error while FTP.ing

by Khen1950fx (Canon)
on May 26, 2011 at 04:23 UTC ( #906748=note: print w/ replies, xml ) Need Help??


in reply to Cannot open local file error while FTP.ing

First, get in the habit of posting a workable snippet. You'll get a better response that way. Second, avoid useless use of interpolation such as  $ftp->put("$file"). Try something like this:

!/usr/bin/perl use strict; use warnings; use Net::FTP; use constant HOST => 'ftp.cpan.org'; use constant DIR => '/mnt/lib'; use constant FILES => 'libs'; my $ftp = Net::FTP->new( HOST, Debug => 1, Passive => 1, Timeout => 1 ); $ftp->login('anonymous'); $ftp->cwd(DIR); $ftp->binary; foreach my $file(FILES) { $ftp->put($file) or die "$@\n"; } $ftp->quit;


Comment on Re: Cannot open local file error while FTP.ing
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://906748]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-10-30 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls