in reply to map question...

map BLOCK returns the last value in BLOCK for each element in the list of arguments. In this case it's returning a list where the first element is an item from @ARGV and the second is the number 1. Presumably the body of the rget method uses the list of elements to populate a hash where the key is the argument and the value set to 1 indicates that it ought to be in effect. There's nothing funky there, so I doubt that is the source of the problem. What may be a problem though is the actual arguments being passed in to @ARGV. What sort of errors are you seeing?


"The dead do not recognize context" -- Kai, Lexx

Replies are listed 'Best First'.
Re: Re: map question...
by k2 (Scribe) on Jun 17, 2003 at 05:52 UTC
    The errors I get is:

    Can't call method "originalLine" on an undefined value at /usr/lib/perl5/site_perl/5.8.0/Net/FTP/Recursive.pm line 55.

    There does not seem to be a problem before it should
    start to download the files,
    it says that Transfer Completes for the LIST command,
    so I guess I should take a look at the code in Recursive.pm
    and try to figure out what it expect in return from
    the FTP-server...
    (se below for the entire debug)

    Thanks
    /k2

    Net::FTP::Recursive: Net::FTP::Recursive(1.5) Net::FTP::Recursive: Net::FTP(2.65) Net::FTP::Recursive: Exporter(5.566) Net::FTP::Recursive: Net::Cmd(2.21) Net::FTP::Recursive: IO::Socket::INET(1.26) Net::FTP::Recursive: IO::Socket(1.27) Net::FTP::Recursive: IO::Handle(1.21) Net::FTP::Recursive=GLOB(0x8066ab4)<<< 220 Service Ready for new User Net::FTP::Recursive=GLOB(0x8066ab4)>>> user FTP_Backup Net::FTP::Recursive=GLOB(0x8066ab4)<<< 331 Password Needed for Login Net::FTP::Recursive=GLOB(0x8066ab4)>>> PASS .... Net::FTP::Recursive=GLOB(0x8066ab4)<<< 230 User FTP_Backup Logged in S +uccessfully Net::FTP::Recursive=GLOB(0x8066ab4)>>> TYPE I Net::FTP::Recursive=GLOB(0x8066ab4)<<< 200 TYPE Command OK I Net::FTP::Recursive=GLOB(0x8066ab4)>>> CWD . Net::FTP::Recursive=GLOB(0x8066ab4)<<< 250 Directory successfully chan +ged to "/data/" Net::FTP::Recursive=GLOB(0x8066ab4)>>> PORT 193,44,120,15,136,14 Net::FTP::Recursive=GLOB(0x8066ab4)<<< 200 PORT Command OK Net::FTP::Recursive=GLOB(0x8066ab4)>>> LIST Net::FTP::Recursive=GLOB(0x8066ab4)<<< 150 Opening data connection Net::FTP::Recursive=GLOB(0x8066ab4)<<< 226 Transfer Complete Can't call method "originalLine" on an undefined value at /usr/lib/per +l5/site_perl/5.8.0/Net/FTP/Recursive.pm line 55.

      I think that somehow you're getting an undef in your array of files (@files in the subroutine _rget) returned by parse_files, so when originalLine is called you see that warning error. It shouldn't happen when you turn off the "Debug" flag, but that's not a very good solution. If you have write access to that file I'd throw a couple of print statements in to see what you're actually getting for files, as well as for the return value of the call to Net::FTP::dir on line 55. If you don't have write access you can throw together a quick subclass that overrides that method and you can examine the information there.


      "The dead do not recognize context" -- Kai, Lexx