>>>>> "A" == Atropo  <lxvasq...@gmail.com> writes:

  A> Hi all,    don't know almost nothing about perl but I'm RTFM.
  A> Dimitre Radoulov gave a perl script to get and delete via ftp some
  A> files. now i want generate a log file with those file names.

  A> I only added the lines starting in uppercase

who told you that you can write perl functions in upper case? perl is
case sensitive and all the functions are in lower case.

  A> perl -MNet::FTP -le'
  A>      ( $host, $user, $pass, $dir ) = @ARGV;
  A>      $MY_FILE  = "recibidos.txt";
  A>      OPEN(PLOT,">>$MY_FILE") or die("The file cannot be opened!");

add $! to the die so you see why it can't be opened. also add the
filename to that string.

  A>      $ftp = Net::FTP->new($host) or die "$...@\n";
  A>      $ftp->login( $user, $pass ) or die $ftp->message;
  A>      $ftp->cwd($dir) or die $ftp->message;
  A>      $ftp->binary;
  A>      /(.*)\.tag$/ and $files_ko{$1} = 1
  A>        or push @files, $_
  A>        for $ftp->ls;
  A>      for (@files) {
  A>          $ftp->get($_) and $ftp->delete($_)
  A>            unless exists $files_ko{$_};
  A>         CHOMP;

why are you chomping that? ftp doesn't return file names with newlines
(that only happens when you read lines from a file or ls output, etc.)

  A>         PRINT PLOT "$_\n";
  A>      }

  A> Undefined subroutine &main::OPEN called at -e line 4.

that is because there is no OPEN function. there is an open
function. you claim to be rtfming but again, where did you get the idea
that upper case functions are supported?

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to