[Israel.pm] Re: callbacks during FTP

Yosef Meller mellerf at netvision.net.il
Thu Feb 5 03:49:24 PST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yehuda Berlinger wrote:
| 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 didn'r see the code, but instead of copying the entire sub, can't you
call SUPER::sub with the relevant parameters and then execute your code?

- --
perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";
for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'

My public key:
http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x3D2CA0A8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAIi3EaElZPz0soKgRAoLjAJ0ZJ4auBvfZlOIjOm12y+F7l1f/zwCggkly
4L4qpJM9eMfNBgo5TIvrjSQ=
=Bt5P
-----END PGP SIGNATURE-----



More information about the Perl mailing list