|
|
| We don't bite newbies here... much | |
| PerlMonks |
Overloading operators: -> to .by theAcolyte (Pilgrim) |
| on Sep 25, 2003 at 22:54 UTC ( [id://294317]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.theAcolyte has asked for the wisdom of the Perl Monks concerning the following question: I was reading some older posts today (having come to PM only recently) and came across this snippet from Jeffa:
Where he redefined += to mean combine arrays. Now, my question is as follows: Can I use the same type of programming to change my method calls from object->method() to object.method() ? Honestly, I'm sure its not bright to do so for reasons of other people maintaining my code ... but it would make *me* happier when I work on purely personal projects. And of course I could switch the -> to mean concatinate, which in some ways makes sense .... I don't need to see code samples of 'how to' or anything ... cause I'd rather puzzle it out myself ;-) ... but I'm wondering if its even possible, and if it is, what issues should I be aware of? (Other then non-standard syntax that could mess up other people). Thank you kind monks for your wisdom, opinions, or bashing. :-) -Erik
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||