in reply to Re^8: How to call a sub reff from a hash
in thread How to call a sub ref from a hash
I'm not understanding the syntax
| This | Can be written more clearly as |
|---|---|
| ${$aref}[$i] | $aref->[$i] |
| ${$href}{$k} | $href->{$k} |
| &{$cref}($arg) | $cref->($arg) |
In this case, the code ref is stored in a hash, so $cref is a hash lookup.
my $cref = $hash{$k}; $cref->($arg) | v ( $hash{$k} )->($arg); | v $hash{$k}->($arg);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: How to call a sub reff from a hash
by NateTut (Deacon) on Dec 16, 2008 at 19:12 UTC |