develooper Front page | perl.perl6.stdlib | Postings from August 2000

How to implement both object->method and module::function interface?

Thread Next
From:
Garrett Goebel
Date:
August 8, 2000 12:23
Subject:
How to implement both object->method and module::function interface?
Message ID:
71BEC0D4E1DED3118F7A009027B1202835C832@EXCH_MISSION
What's the conventional wisdom on creating a module that supports both an OO
and non-OO interface? Are there any CORE or CPAN modules to serve as a
textbook, or is the anwser "Don't do that"? 

I've got some code that checks the first parameter passed to see if it is a
reference, assumes any reference is an object reference... and then proceeds
accordingly. -It feels pretty sloppy, but it works.

Garrett

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About