Maybe OT. But just curious. What do the experts say about exporting function from OO modules??. Everytime i need something like this, i end up making those functions as Class methods.
-Sharad > -----Original Message----- > From: Dan Muey [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 29, 2003 3:34 PM > To: [EMAIL PROTECTED] > Subject: RE: Module Object and sub module function > > > Sorry for the confusion, I was switching example names on everyone. > > I think I've got it. > > I've made it object oriented and functional based. (Gulp, > kinda scary :-)) > > I have > > package Parent::Module::MyModule; > > With simply bare function names like so: > (IE not Parent::Module::functionname {} so as not to invad > namespace) sub funtionname {} > > So One can do this: > > use Parent::Module::MyModule; > my $r = Parent::Module::MyModule::functionname($parentobj,$arg); > > use Parent::Module::MyModule; qw(functionname); > my $r = functionname($parentobj,$arg); > > Or if new() is called each function is "smart" enough to know > that the first > thing is a $self object and not the parent $obj and to use > $self->{Parent} > for the parent $obj. > > use Parent::Module::MyModule; > my $newobj = new Parent::Module::MyModule($parentobj); > my $r = $newobj->functionname($arg); > > Does that seem about right? > > Sorry for the confusion but it's been a fun learning example for me, > sorry if I made it Monday for you :) > > Dan > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]