SPUG: code reference callback on a class method
Parr, Ryan
Ryan.Parr at wwireless.com
Fri May 31 13:58:33 CDT 2002
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 :)
-- Ryan Parr
Common sense is the collection of prejudices acquired by age eighteen.
-- Albert Einstein
-----Original Message-----
From: SPUG-list-owner [mailto:tim at consultix-inc.com]
Sent: Friday, May 31, 2002 8:19 AM
To: spug-list at pm.org
Subject: SPUG: code reference callback on a class method
How do you do a callback on a class method? For
example:
Zub process_files {
my $self = shift;
# stuff
}
Zub process {
my $self = shift;
find(\&process_files, @ARGV);
}
I'm trying to get the first argument of find() to be a
callback using $self->process_files()
I went to the books on subroutines and references, but
I'm stuck. Any help would be greatly appreciated.
Thank you!
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
----- End forwarded message -----
--
*===========================================================================
===*
| Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866)
DOC-LINUX |
| tim at consultix-inc.com teachmeunix.com teachmeperl.com
| teachmelinux.net | JUNE 3-7: Perl Programming, plus Modules; JULY
| 8-11: OO Perl Fundamentals |
*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- *
| NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle
7/15-19 |
| Adv. OOP * Adv. Module Techniques * Programming Perl 6 * Text
| Parsing |
*===========================================================================
===*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list