Angie Ahl wrote:
> ...
> These subroutines are called externally ie
> HLOM::Links->FindLink(LinkID => $id);
> 
> but also internally ie  &FindLink(LinkID => $id);
> 
> I read in Perlsub that doing &FindLink will pass the current @_ to the
> subroutine. Great.

Only if you omit the argument list as well.

> 
> But I thought that doing &FindLink(LinkID => $id); would not pass the
> current @_ which is what I want. ie I only want to pass the param
> LinkID not all the other stuff that was passed to the subroutine that
> called the subroutine....

True, but FindLink is expecting a class name before the list of key/value
pairs.

So you need:

   FindLink($class, LinkID => $id);

or better,

   $class->FindLink(LinkID => $id);

The latter is preferred, since it allows FindLink to be inherited by a
subclass.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to