Here is another alternative:
Update:Added Chromatic's OO-Style + Docforeach my $MySubName (@list) { ## &{\&$MySubName}($MySubName); # This works! ## $::{$MySubName}($MySubName); # This (tmoertel) is better. no strict qw(refs); &{*$MySubName}($MySubName); # Use GLOB - Also cool! #Chromatic's OO way -- #can(METHOD) # can checks to see if its object has a method called METHOD, # if it does then a reference to the sub is returned, i # if it does not then undef is returned. # main->can($MySubName)->($MySubName); }
Earth first! (We'll rob the other planets later)
In reply to Re^2: Canon concerning coderef calls?
by NetWallah
in thread Canon concerning coderef calls?
by jobi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |