[Israel.pm] Re: callbacks during FTP

Issac Goldstand margol at beamartyr.net
Thu Feb 5 11:22:06 PST 2004


Not really - I've actually also subclassed many parts of the LWP suite
making custom site scrapers, or parsers or other things...  Usually, I build
a routine *around* the existing routine which calls $self->SUPER::sub, but
to *insert* a callback, one would have to modif the SUPER class itself...

  Yitzchak
----- Original Message ----- 
From: "Yosef Meller" <mellerf at netvision.net.il>
To: "Perl in Israel" <perl at perl.org.il>
Sent: Thursday, February 05, 2004 1:49 PM
Subject: Re: [Israel.pm] Re: callbacks during FTP


> -----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-----
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>
> YAPC::Israel::2004
> http://www.perl.org.il/YAPC/2004/
>




More information about the Perl mailing list