Even in cases when method isn't directly manipulating $MyObject but
impacting a whole class?
I'll be the first to admit that I'm not an OO guru; I've never been
teached "proper OO" (if there's such a thing) by a teacher (never attended
computer science at school), and I might not be familiar with the OO
terminology. I have, however, been programming "OO-style" for several
years (since the early 90's). And I've read Damian Conway's excellent
book about OO programming in Perl.
And:
There is no such thing as "manipulating a whole class", or - as you
describe it - impacting a whole class. You never work with _classes_.
You work with objects, which are _instances of classes_.
Therefore, IMO, one should avoid calling a class' method without going
through an instance of the class (even if this is possible in Perl).
If you're "manipulating a class directly", there is no need for objects
(or classes) in the first place. You would be dealing with "ordinary Perl
modules", which _will_ be troublesome in the long run.
Cutting from an other post from you:
So basicaly it would be safest to call Foo()
$self->Foo(); within the package [...]
Yes. If the method 'Foo()' is a member of the same _class_. Please be
specific when you're talking about packages/modules and/or classes. There
is a difference.
[...] and SomeClass->Foo(); from other packages?
No. You _should not_ call the class' method directly. You should rather,
as I've already pointed out, call the method on an instance (ie. an
object) of the class.