in reply to Using FTP Without any Modules
I wrote this years ago, before I knew any better way to do it, and it's been working fine.
To completely understand the code, you need to know that I have two arrays for each site... one stores the site address, and the other stores the login info.
So for ftp site 'example', then, you'd have:
The code snippet to get all the files reads as follows:$address{'example'} = "ftp.foobar.com"; $userpwd{'example'} = " user foo bar\n";
I don't know that it's the best way to do it, but it's been working for me... I'd definately be open to suggestions for improving it.$ftpcmd = "ftp -n " . $address{$myadd}; $ftpstr = $userpwd{$myadd}; open(TST,"|$ftpcmd"); print TST $ftpstr; print TST " prompt\n"; print TST " mget *\n"; close(TST);
Trek
|
|---|