[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [Fun With Perl] Package Retrofit



On Fri, Jun 11, 1999 at 11:36:43AM -0700, John Kristian wrote:
> Chris Nandor wrote:
> 
> >     if (not can Mozilla::LDAP::Entry 'getLDIFrecords') {
> >         *Mozilla::LDAP::Entry::getLDIFrecords = sub {
> >             [snip]
> >         };
> >     }
> >
> > It does the same thing, but avoids the eval.  You don't need a separate
> > package declaration, you can just put it in the sub declaration.
> 
> Huh?  Would you give an example, please?  Or did you mean to say I don't need
> any package declaration at all (as in the example above)?
> 

That's what he meant.  Note in the above example that instead of using a
separate package declaration, as in:

package Mozilla::LDAP::Entry;
*getLDIFrecords = sub { };

the package is specified in the assignment:

*Mozilla::LDAP::Entry::getLDIFrecords = sub { }


Ronald

==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org