Re: Indirect method invocation
- From: lists@xxxxxxxxxxx (Jan Eden)
- Date: Wed, 27 Jul 2005 17:49:24 +0200
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 = (
display => sub { $item->display() },
move_picture => sub { $item->move_picture($item->{id}, $item->{parameters}->{position}) },
commit => sub { $item->commit() }
);
$actions{$parameters{mode}}->();
Thanks,
Jan
--
I used to have a Heisenbergmobile. Every time I looked at the speedometer, I got lost.
.
- Follow-Ups:
- Re: Indirect method invocation
- From: Randal L. Schwartz
- Re: Indirect method invocation
- References:
- Indirect method invocation
- From: Jan Eden
- Indirect method invocation
- Prev by Date: login shell?
- Next by Date: Re: Help: automated email forwarding similar to .forward
- Previous by thread: Indirect method invocation
- Next by thread: Re: Indirect method invocation
- Index(es):
Relevant Pages
|