Can I ask why you're doing all that work in the new() method? Why not just something like:
package IsaCGI;
use strict;
use CGI;
use vars qw(@ISA);
@ISA=qw(CGI);
sub my_method{
return "hello from isa_cgi\n";
}
A CGI instance is blessed like:
sub new {
my($class,$initializer) = @_;
my $self = {};
bless $self,ref $class || $class || $DefaultClass;
...
which means that in your code, if you do:
my $q = new IsaCGI;
it will be blessed into the IsaCGI class. Is there a reason you're not doing it that way? Even in more complicated scenarios of inheritance, one gets the base object first, then tinkers with it. You seem to be doing it the other way around.