in reply to Syntax question: Method call, where method name is calculated from an expression
Yes, using the reference/dereference trick:
$object->${\method()}(@args);
Here, method() is called, a reference to the result is taken through the backslash, and that reference is de-referenced via ${ }. The resulting method is called on behalf of $object, passing along @args.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Syntax question: Method call, where method name is calculated from an expression
by rovf (Priest) on Dec 04, 2009 at 15:52 UTC |