in reply to Re: My first Perl module...
in thread My first Perl module...

Hmm, so is defining %self globally the answer? It doesn't seem like it should be to me, but I'll of course defer to your judgement. :)

Replies are listed 'Best First'.
Re: Re: Re: My first Perl module...
by t0mas (Priest) on Nov 17, 2000 at 14:33 UTC
    No, defining %self is not the answer (and I don't think snax said it was). You should use a valid syntax for references, like $self->{"_ldap"}, to refer to the anonymous hash that $self refers to.

    /brother t0mas
Re: Re: Re: My first Perl module...
by snax (Hermit) on Nov 17, 2000 at 16:50 UTC
    t0mas is correct -- I don't suggest that you declare %self globally, especially since it really won't do what you want it to do :)

    Check out perlman:perlref for more details on using references, and poking through perlman:perlobj and/or perlman:perltoot is probably a good idea, too.

Re: Re: Re: My first Perl module...
by Fastolfe (Vicar) on Nov 17, 2000 at 20:14 UTC
    $hash{key} refers to the 'key' element of the hash called %hash. $hash->{key} refers to the 'key' element of the hash referred to in the reference $hash. $hash has nothing to do with %hash. Check out perlref and other documentation mentioned by others.