in reply to Re: method dispatch question
in thread method dispatch question
Indeed, I missed it, and it works very well. But now let us make the problem a bit more complicated (I see that I have simplified to much from my original problem): Assume that $mref does not come in as parameter, but will be calculated somehow; for example:
Can this still be written in one line, without intermediate variable $mref? I learned that my original idmy $mref=$self->get_mref(...); # Calculate $mref $self->$mref(...); # use it to dispatch
does not work, but extending your suggestion to this case would, I think, fail too:$self->&{ $self->get_mref(...) }()
Can this (now more complicated) example be easily solved too?$self->($self->get_mref(...))()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: method dispatch question
by moritz (Cardinal) on Jul 09, 2008 at 12:20 UTC | |
by rhesa (Vicar) on Jul 09, 2008 at 12:41 UTC | |
|
Re^3: method dispatch question
by rafl (Friar) on Jul 09, 2008 at 12:35 UTC | |
|
Re^3: method dispatch question
by Arunbear (Prior) on Jul 09, 2008 at 12:34 UTC |