eval { my $foo = new SomeClass; $SIG{__WARN__} = sub { die @_ }; $foo->initialize; $foo->run; }; if ($@) { print "content-type: text/html\n\n$@"; exit; } package SomeClass; sub new { bless { }, shift; } sub initialize { my $self = shift; require CGI; $self->{cgi} = new CGI; return $self; } sub run { my $self = shift; SomeOtherClass::SomeSub($self); # Is there any other way of sending $self to SomeOtherClass without doing it this way? Note: I know I could use @IAS and make SomeOtherClass a SomeClass but I'd rather not create a new instance of the cgi module if it can't be helped. } package SomeOtherClass; sub SomeSub { my $self = shift; print $self->{cgi}->header, 'Hello World!'; }