[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    Passing references to subroutines in other packages
From:       "Ted Mao" <tmao () uclink ! berkeley ! edu>
Date:       2000-12-28 10:11:15
[Download RAW message or body]

I have a problem which seems simple, but I haven't found a solution to it
yet.

Let's say I have two packages, A and B.  In a subroutine of package A, I'm
trying to return a reference to a subroutine in package B.  So in package A
I have:

my $refToB = \&B->someFunction;

But that gives me the error:  "Undefined subroutine &A::someFunction."
This also doesn't work:

my $refToB = \B->someFunction;

That one returns a reference to B->someFunction AFTER it has been evaluated
with no arguments.  So if B->someFunction() returned "0", $refToB would be a
reference to a scalar containing "0".

Help would be greatly appreciated.

- Ted Mao <ikibbles@bigfoot.com>


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic