I have not had a chance to try this yet but it sounds very promising.

Begin forwarded message:

From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
Date: Wed Nov 13, 2002  2:02:59 PM US/Pacific
To: [EMAIL PROTECTED]
Subject: Re: code ref and objects

On Nov 13, todd shifflett said:

the above works.  Now I would like to be able to pass in a subroutine
from a declared object.
You mean a "method" (that is, a function that is "bound" to an object).

my $fft = new Math::FFT(\@nums);

print foo(\&{'fft->stdev'},\@nums);
You want to use the UNIVERSAL::can method:

my $fft = Math::FFT->new(\@nums);
print foo($fft->can('stdev'), \@nums);

perldoc UNIVERSAL

--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to