nysus has asked for the wisdom of the Perl Monks concerning the following question:
This snippet of code will generate a list of symbols for a particular package, called PackageName:
sub dispSymbols { my($hashRef) = shift; my(%symbols); my(@symbols); %symbols = %{$hashRef}; @symbols = sort(keys(%symbols)); foreach (@symbols) { print Dumper printf("%-10.10s| %s\n", $_, $symbols{$_}); } } dispSymbols(\%PackageName::);
But let's say I want to discover all the different packages that I can use inside of the dispSymbols call. How can I generate a list of those top-level packages?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I generate a list of available top-level packages?
by tobyink (Canon) on May 06, 2020 at 18:18 UTC | |
by nysus (Parson) on May 06, 2020 at 20:46 UTC | |
by haukex (Archbishop) on May 07, 2020 at 07:44 UTC | |
Re: How do I generate a list of available top-level packages?
by jcb (Parson) on May 08, 2020 at 00:03 UTC | |
Re: How do I generate a list of available top-level packages?
by nysus (Parson) on May 06, 2020 at 18:15 UTC |
Back to
Seekers of Perl Wisdom