[plug] Perl Query...

Trevor Phillips phillips at central.murdoch.edu.au
Wed Jan 31 16:26:51 WST 2001


Colin Muller wrote:
> 
> Trevor Phillips wrote:
> > This syntax seems to work fine where you have an object, but not when you have
> > a module. ie; doing Class->$bink(@args) doesn't seem to work. And that's what
> > I'm after...
> 
> That will work if the package Fred is inside the script you're calling
> it from. If the package Fred is in another file, first say:
> 
> use Fred;
> 
> Then your call should work - provided Fred is locatable in your @INC
> directories.

Sincere apologies. I got confused. ^_^;;
The syntax Class->$bink(@args) does in fact work fine! I was getting confused,
as the routine I was calling (something that was processing a text var passed),
was returning the name of the package. eg; "Class".

Because, of course, using the -> syntax, the first argument actually passwd is
the Object/Module, and the SECOND param is the first param passed. The
subroutine wasn't originally to be called externally, and as such wasn't
expecting that first parameter.

I'm now rewriting the couple of routines to support obj->func format calls.

Still, I'd be curious if there's a way of doing Class::$bink(@args) which
doesn't pass the obj/module...

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator     -           T.Phillips at murdoch.edu.au : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list