[Perl-unix-users] Re: Callbacks?

2001-01-09 Thread Philip Newton
Carl Jolley wrote: > On Fri, 5 Jan 2001, Martin Moss wrote: > > > All, > > > > I'm trying to write a callback process in a script I'm writing. > > Basically I have a reference to a subroutine, and I want to > execute that > > subroutine and pass it some parameters, > > I'm not sure exactly wha

[Perl-unix-users] Re: Callbacks?

2001-01-09 Thread Philip Newton
Martin Moss wrote: > Ah, that's what I'd thought to do, however I think I've > missed a step. I want to hide the subroutine referencing > code from the user thus I want to do something like this:- > > > my $Papp = new iBus::Papp('debug' => 1, 'callback' => "::MySub", 'LogFile' => '/var/log/MyPa

[Perl-unix-users] Re: Callbacks?

2001-01-09 Thread Philip Newton
Martin Moss wrote: > how can I tell that the reference I've been given is > actually a reference to a subroutine? print "subref" if ref($callback) && ref($callback) eq 'CODE'; perldoc -f ref ref returns undef if the variable is not a reference, and 'CODE' for a subref. Cheers, Philip _