http://www.perlmonks.org?node_id=21713

I hope that will work properly :)
#!/usr/bin/perl &just;sub just{&another};sub another{&perl};sub perl{&hacker}; sub hacker{foreach $ja(sort keys %main::){local *ph=$main::{$ ja};if(defined &ph){push @japh,$ja}}};@japh=(@japh)[2,0,3,1]; print "@japh\n";

/Maqs

Replies are listed 'Best First'.
RE: Self sufficient? :)
by vkonovalov (Monk) on Jul 10, 2000 at 10:09 UTC
    Good idea, but why to be so noisy? Each %main:: can be easily replaced with just %::

    Look what becomes after little modifications:

    &just;sub just{&another};sub another{&perl};sub perl{&hacker}; sub hacker{@japh=grep{defined &{$::{$_}}}sort keys %::} print "@japh[2,0,3,1]\n";