in reply to Problem with header() method when extending CGI.pm
A CGI instance is blessed like:package IsaCGI; use strict; use CGI; use vars qw(@ISA); @ISA=qw(CGI); sub my_method{ return "hello from isa_cgi\n"; }
which means that in your code, if you do:sub new { my($class,$initializer) = @_; my $self = {}; bless $self,ref $class || $class || $DefaultClass; ...
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.my $q = new IsaCGI;
|
|---|