[Israel.pm] Re: callbacks during FTP

Yehuda Berlinger jon at actcom.co.il
Wed Feb 4 13:23:45 PST 2004


For the life of me, I can't figure out why there is no call back in 
Net::FTP's get and put functions.

I created a subclass of Net::FTP, copied over the get and put 
functions and added a callback argument and a single line:

&{$cb}($buf,$len) if ref $cb eq 'CODE';

to both functions and it works great.

I will send this off to the author as soon as I get a chance.

Yehuda

> I would like to do a callback while transferring via FTP, so as to
> print % finished, etc... Net::FTP doesn't seem to support this. Is
> that correct? Is there any other tool that can do this? Is there
> anyway to do this using the 'hash' mechanism?




More information about the Perl mailing list