The reason is see power in C++ in contrast to Java is because C++ offers one to still be able to use functional code. When I'm writing a larger program, I may prefer to have a few variables or functions that i don't want in classes of any type. If I call them often or it just doesn't make sense to encapsulate various vars in a class, then I'm not forced to. Along the same lines, perl forces no one to use OO programming and Perl is even less OO (in my humble opinion) than C++. Look at any complete code and the integral parts of the program are most likely functionally-based which incorporate nifty CPAN modules. To give an example of my above comment on things that I may not wish to encapsulate is:
- a single variable that really has nothing to do with any others (waste of time to throw in a class with various protections that I can keep track of myself
- or a bunch of random variables that have nothign to do with each other and would be otherwise lonely variables (it wouldn't make sense to bundle them together)
- functions I'll be using alot (skipping a class name may save me typing in the long run:-O)
- global variables that I'll be using alot that are encapsulated in their own right (like my own personal %configuration hash).
And that's what I love with Perl /\/\