in reply to Re: Canon concerning coderef calls?
in thread Canon concerning coderef calls?
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Canon concerning coderef calls?
by revdiablo (Prior) on Nov 15, 2004 at 22:40 UTC | |
by NetWallah (Canon) on Nov 16, 2004 at 03:28 UTC | |
by revdiablo (Prior) on Nov 16, 2004 at 06:06 UTC |