list_class_options

Use last saved data if available since this is the typical usage.

#-------------------------------------------- # UNIVERSAL #--------------------------------------------

package UNIVERSAL;

sub dir{ my ($s) = @_; # class or object my $ref = ref $s; my $class = $ref ? $ref : $s; # myClass my $pkg = $class . "::"; # MyClass:: my @keys_raw; my $is_special_block = qr/^ (?:BEGIN|UNITCHECK|INIT|CHECK|END|import|DESTROY) $/x;

no strict 'refs';

while( my($key,$stash) = each %$pkg){
#     next if $key =~ /$is_special_block/;   # Not a special block
#     next if $key =~ /^ _ /x;               # Not private method
   next if ref $stash;                    # Stash name should not be a reference
   next if not defined *$stash{CODE};     # Stash function should be defined
   push @keys_raw, $key;
}

my @keys = sort @keys_raw;

return @keys if defined wantarray;

say join "\n  ", "\n$class", @keys;
}