Not long ago, Ryan Nielsen proclaimed...
> Okay, I got my package to work, well partially.  I am making a call to 
> the package:
> 
> package::sub( variable );
> 
> But my variable doesn't seem to go through.  I get the error saying the 
> variable is undefined.  I am trying to assign it with shift, like:
> 
> sub mySub {
> my $var = shift;
> }
> 
> I'm positive the variable I am passing is defined.  Do I have to pass 
> the variable a specific way?

The problem here is that the package/object name is the implicit parameter.
This will work:

  sub mySub {
    my $class = shift;
    my $var = shift;
    ...
  }

-=Fozz
-- 
[EMAIL PROTECTED] is Doran L. Barton, president, Iodynamics LLC
Iodynamics: Linux solutions - Web development - Business connectivity
 "Eat your fingers off!"
    -- KFC's 'finger lookin good' as it was translated into Chinese

Attachment: pgpwqBVh9XkLh.pgp
Description: PGP signature

.===================================.
| This has been a P.L.U.G. mailing. |
|      Don't Fear the Penguin.      |
|  IRC: #utah at irc.freenode.net   |
`==================================='

Reply via email to