christopher j bottaro wrote:

> ahh thank you.
>
> so saying
>
> package CJB;
>
> is like saying
>
> namespace CJB   {

I was afraid of this when you said that you knew C++, therefore you know what
classes are.  It is good to see the parallels between languages, but it can also
cause problems.  Perl has its own structure, distinct from any other programming
language.  If you try to superimpose C++ paradigms on Perl syntax you will miss
the point.

Bob is right, I think, that Perl packages are *closer* to C++ namespaces than to
C++ classes.  You can import any functions exported from a Perl package with or
without an object.  The module creator chooses which functions are freely
exportable and which can be exportd on demand.

I would recommend that you keep the C++ parallels a little farther back in your
mind, and learn Perl OO afresh.  A good set of starters would be:

perldoc perlref     #since references are key to using Perl objects

perldoc perlobj
perldoc perlmod

Bob has given you a very good, concise rundown on the basics of each of these
definitions.  They will flesh out as you start to work with them.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to