> "Jan" == Jan Eden <[EMAIL PROTECTED]> writes:
Jan> I finally came up with something myself:
But that's no longer a method call.
You can do an indirect method call, but it needs to be a simple scalar:
my $method = $parameters{mode};
$object->$methods(@args);
--
Randal L. Schwartz - Stone
On Jul 27, 2005, at 17:21, Jan Eden wrote:
My other problem is that the cookbook quotes (something like) the
following code as an example for storing method names:
my %actions = (
display => $item->display(),
move_picture => $item->move_picture($item->{id}, $item->
{parameters}->{position}),
Hi,
Jan Eden wrote on 27.07.2005:
>In other words, I would like to have something like the %actions
>hash to construct a more flexible version of the $item->$mode()
>construct, where I can pass different additional parameters to each
>method.
I finally came up with something myself:
my %actions
Hi,
it does not seem to be possible to use indirect method invocation with anything
but a scalar. While this works:
my $mode = $parameters{mode};
$item->$mode();
I cannot seem to find a proper bracketing to make this work:
$item->$parameters{mode}();
Is my assumption correct?
My