Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: lcd in Net::FTP module

by derby (Abbot)
on Aug 04, 2009 at 11:04 UTC ( #785719=note: print w/ replies, xml ) Need Help??

in reply to lcd in Net::FTP module

While lcd makes sense when you're in an interactive FTP session, you really don't need it when scripting (at least with perl) -- use the built-in chdir function:

use Net::FTP; my $ftp = Net::FTP->new("", Debug => 0) or die "Cannot connect to $@"; $ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->message; $ftp->cwd("/pub") or die "Cannot change working directory ", $ftp->message; chdir "/tmp" or die "Cannot change local directory ", $!; $ftp->get("that.file") or die "get failed ", $ftp->message; $ftp->quit;
(modified from the example at Net::FTP).

Comment on Re: lcd in Net::FTP module
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2015-11-25 18:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (684 votes), past polls