ftpput script: perl ?

Taavi Burns taavi-LbuTpDkqzNzXI80/IeQp7B2eb7JE58TQ at public.gmane.org
Sun Apr 18 03:50:07 UTC 2004


On Sat, Apr 17, 2004 at 04:44:45PM -0400, William O'Higgins wrote:
> On Sat, Apr 17, 2004 at 04:03:08PM -0400, Rick Delaney wrote:
> >> > On Sat, 17 Apr 2004, Peter L. Peres wrote:
> >> >
> >> > >
> >> > > Hi, I wrote a small ftp upload script in tcl (without using expect). Now
> >> > > I'm looking for a perl equivalent. The script should be small and if
> >> > > possible implemented natively (no imported modules). Is there such a thing
> >> PS: Is there a Perl solution anyway ? I'd like to see how others program
> >> sockets after having done my own version.
> >
> >They use modules, in this case Net::FTP.
> 
> Not necessarily.  See this: http://nerd.cx/get.php?code20030911

Though then you have to know and use the actual FTP protocol directly,
which is ugly.  That example only auths, does a dir listing, and quits.
You'd have to deal with how to read/write files over ftp to make it
useful.

Naturally if you feel like using perl instead of bash, you can do
a simliar kind of thing:

open FTP, "|ftp -i hostname";
print FTP <<EOT;
binary
get file.avi
quit
EOT

-- 
taa

   Yield to temptation; it may not pass your way again.
      - Robert A. Heinlein
/*eof*/
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list