in reply to ftp multiple files

If you are indeed using a plain shell call over Net::FTP (as suggested above) you might as well use mput which allows filemasks... something like mput *.txt is ofcourse possible.
Net::FTP doesn't appear to have mput (and mget), but you can loop a put statement : foreach $file (@files) { $ftp->put($file); }

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: ftp multiple files
by nkpgmartin (Sexton) on Apr 17, 2001 at 00:04 UTC
    Do you get my reply to the other responses? I don't have the Net::ftp module; only you provided a non Net::ftp solution. I tried this and I get the following message:
    #!/usr/bin/perl @files = ($file1,$file2,$file3); print "Enter $rem_host login name\n"; $rem_user = <STDIN>; chop $rem_user; print "Enter password\n"; $rem_passwd = <STDIN>; chop $rem_passwd; $rem_host = machinename; $log = "log \n"; $command =<<eod; foreach $file (@files) { ftp->mput($file); } # ?? (where do i put this) ftp $rem_host << eof > $log; user $rem_user password $rem_passwd bye eof eod
    error: Can't call method "mput" on an undefined value at ./eod.pl... I also tried "put" - same error. Can you clarify what you mean about mput*.txt? Obviously, I'm not sure what you mean. Thanks!
      Put and Get dont appear to be in the FTP RFC... mput and mget are basically client side commands, check man pages on ftp

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.