and your polluting your namespaces...
No your not only polluting main:: you have to pollute every package/class which makes use @employees, or you have always to write Employees::list_active(\@employees) or import from Employees!
And additionally you have to build parameter checking to avoid calling list_active_employees with the wrong object.
... but if something was designed and used for a long time as a plain, transparent data structure, then all the code accesses it as such. And does things you would not want code to do with the insides of an object. ...
You're still thinking within the chains of the old functions. If you used everything from the beginning as an object, you'll have no problems to protect the inside afterwards.
That's why I started using Tie in "Phase 2".
Anyway you might get me wrong, I'm not opposed against writing push @$arr,"elem" as long as it's clear that it's nothing else than $arr->push("elem"), so I can have the best of both worlds and stay backwards compatible.
Other languages do this and actually that's already more or less the mechanism behind tie.
Just the interface in Perl is really messy, confusing and obfuscating the code...
Cheers Rolf
In reply to Re^4: Benefits of everything is an object? Or new sigils?
by LanX
in thread Benefits of everything is an object? Or new sigils?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |