Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OOP in Perl. Trying to undestand various things. 3

Status
Not open for further replies.

garymgordon

Programmer
Apr 5, 2000
307
US
If anyone can help, I have a series of questions that I would like to request some clarification onvregarding OOP in Perl.

I'll spit them out one at a time to try and make it easier to answer and easier for me to try and understand.

STATEMENT: I am reading that OBJECTS are defined within modules. A module can be identified as defining an object by the inclusion of a constructor. A constructor is a special subroutine that defines a data type to maintain the attributes of a class and returns a reference to this variable.

QUESTION:

Are objects ONLY defined within modules? If not, where and how are they 'defined'?

Can you explain the above STATEMENT on a level that a beginner can understand it?

Thanks,
Gary


Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Gary, you sure are ambitious! You don't even know perl that well yet and already you're trying to understand object-oriented perl? I've been using perl for years and I still haven't gotten the object-oriented part down completely yet! Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Ditto!

is this not about the 3rd time this post has shown up???
Please don't cross-post or post twice.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Mike,

The fact that Gary has asked the question more than once is probably more to with my inadequate answer on constructors than anything else. <wry smile>

How about this for a definition then:

A constructor:

A procedure or function, often called &quot;new&quot; that creates an object as defined by a module (package, in perl). It must be called before the objects defined by that package are used.

Anyone care to improve that with me?

tsd -- What about writing a &quot;The Care and Feeding of Objects for Beginners&quot; FAQ with me? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Mike,

Thanks.

I guess that I asked a question (either more than once or in a different way) not necessarily due to YOUR previous answer, but just because I needed a slightly more indepth answer - based on the my current level of understanding.

It wasn't you. But I do thank you for understanding that I am sincerely trying to understand this stuff. :)

So, THANK YOU.

Your current answer regarding CONSTRUCTOR ... was great.

Thanks again,
Gary

PS: If I seem to repeat myself (to some degree) ... please don't get upset with me. Sometimes, ... I think I understand something .. but then when I look even closer at it ... I still end up haveing questions. I hope you'll bear with me as I try to learn.

Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
I'm not upset, but I monitor several foroums, (as do most of us) and I don't have all the time in the world, so it's easier on everyone if you stick with the most appropriate foroum.

Also, if I post in a thread, I read every follow up in that thread, as I assuem you all do, too) so you can just post things that need clarification in the same thread as the original

These aren't rules, just understandings that I think make things go more efficiently for everyone.

That being said, I'm glad to help, and ask away!!

MWB.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Thanks.

Again, sorry for my 'mis-use'.

I will try to keep things together.

Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top