package Test; sub new { my $class = shift; my $item = {}; print "DEBUG : creating object in " . __PACKAGE__ . "\n"; bless $item , $class; return $item; } 1; #### package Test::Command; use strict; use warnings; use Test; use vars qw(@ISA); @ISA = qw(Test); sub new { my $item = shift; my $command = shift; my $class = ref( $item ) || $item; my $self = bless $item->SUPER::new(), $class; print "DEBUG : handling command $command in " . __PACKAGE__ . "\n" if ( $command ); } 1; #### #!/usr/bin/perl use strict; use warnings; use lib 'lib'; use Test; use Test::Command; $|=1; my $test_command = Test::Command->new(@ARGV); #### DEBUG : creating object in Test DEBUG : handling command test_command in Test::Command #### my $test_command = Command->new(@ARGV); #### Test::Command::$command #### Test::Command::$command->handle_output()