SPUG: code reference callback on a class method

Matt Tucker tuck at whistlingfish.net
Fri May 31 14:45:48 CDT 2002


-- "Parr, Ryan" <Ryan.Parr at wwireless.com> spake thusly:

> Zub process_files {
>   my $self = shift;
>   # stuff
> }
> 
> Zub process {
>   my $self = shift;
>   find(sub { $self->process_files(@_) }, @ARGV);
>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> }
> 
> But there's probably a better way :)

Actually, I'd say this is the best way to do it. I've had a need for
this sort of thing before, and that's my preferred solution.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20020531/d33b8457/attachment.bin


More information about the spug-list mailing list