List all packages in a file.pm

G

gupit

Hi,
If I have multiple packages in the same file, how do I list all the
packages in that file?

State.pm:
--------------------------------------
pacakage State;
# abstract class for defining interface

sub factory { ... }
sub new { ... }
sub execute { die "never reach here\n"; }

package StateBegin;
use base qw(State);
sub execute { # do setup; # change state to StateStep1 }

package StateStep1;
use base qw(State);
sub execute { # do step1 processing; # change state to StateStep2 }

package StateStep2;
use base qw(State);
sub execute { # do step2 processing; # change state to StateEnd }

package StateEnd;
use base qw(State);
sub execute { # done }


I want to list all the possible states the script can be in
prgrammatically.
%INC only lists State.pm.

Thx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top