in reply to Overloading operators: -> to .
As noted above, the precedence will be slightly off.my $meth = "hello"; $foo->$meth(@args); # Calls method 'hello' on $foo with @args
This will only apply to objects in classes which have your overload set.
If you want to attempt a more aggressive approach, you can use Filter::Simple to rewrite your code on the fly. That will get the precedence wrong, though you will have far more trouble making your code correct.
UPDATE: Zaxo is right. Using overload can make the method call happen, but making it pass arguments is another story...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Overloading operators: -> to .
by belg4mit (Prior) on Sep 26, 2003 at 03:37 UTC | |
by theAcolyte (Pilgrim) on Sep 26, 2003 at 04:39 UTC | |
|
Re: Re: Overloading operators: -> to .
by theAcolyte (Pilgrim) on Sep 26, 2003 at 03:24 UTC |