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/MyPappLog.lo
g');

$Papp->Start;

sub MySub
{
        print "Hello world";   #:-)
}

So what I want to be able to do is to take the '::MySub' string and make a
reference to that subroutine and then execute that reference.

Marty

> -----Original Message-----
> From: Philip Newton [mailto:[EMAIL PROTECTED]]
> Sent: Monday 08 January 2001 13:16
> To: 'Martin Moss'
> Cc: [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: Re: Callbacks?
>
>
> 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

_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to