in reply to (chromatic) Re: Looping on function names
in thread Looping on function names
both terrifies me, and amazes me. i guess, i know you can do that, and i'm pretty sure i've done it myself... but damn... next time anyone tells me perl isn't a real language that alows you to do powerful things, i'm going to shove this example of raw power down their throats.foreach (keys %main::) { # use whichever package you prefer no strict 'refs'; # else the next line fails if (defined *{$_}{CODE}) { print "$_\n"; # could be pushed onto an array, } # into a hash }
|
|---|