On Jul 3, Pozsar Balazs said:

>my %funcs=(
>    "one"=>           \&first,
>    "two"=>           \&second);
>
>Then how can I call 'first'? Obviously, using %funcs, i mean :).

There are two (general) ways to dereference arrays, hashes, and functions:

  CREATE REFERENCE    ARROW SYNTAX    SIGIL SYNTAX
  $x = \@array;       $x->[$idx]      $$x[$idx]
  $x = \%hash;        $x->{$key}      $$x{$key}
  $x = \&function;    $x->(@args)     &$x(@args)

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to