in reply to Calling a hash member
If you really don't want to use a temporary variable (though I don't see why not), it may be possible to store a hard reference instead of a soft reference:
use ProjectA; my $project = 'ProjectA'; my %ThingsToDo = (firstTask => \{$project->prepare}); $ThingsToDo{firstTask};
Alternatively, you could make a dispatcher method in the ProjectA class that executes a given method:
use ProjectA; my $project = 'ProjectA'; my %ThingsToDo = (firstTask => 'prepare'); $project->doMethod($ThingsToDo{firstTask});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling a hash member
by ikegami (Patriarch) on Dec 13, 2006 at 21:27 UTC | |
by geekphilosopher (Friar) on Dec 14, 2006 at 01:46 UTC | |
by ikegami (Patriarch) on Dec 14, 2006 at 02:06 UTC | |
by geekphilosopher (Friar) on Dec 14, 2006 at 02:42 UTC | |
by ikegami (Patriarch) on Dec 14, 2006 at 03:58 UTC | |
|
Re^2: Calling a hash member
by revdiablo (Prior) on Dec 13, 2006 at 22:01 UTC |