develooper Front page | perl.beginners | Postings from February 2009

OO -> Cgi->param not working with inheritance

Thread Next
Brent Clark
February 24, 2009 00:20
OO -> Cgi->param not working with inheritance
Message ID:

I im new to the perl OO ways.

I got my package as so.

package htmlhandler;

use strict;
use Data::Dumper;
use CGI;

my $cgi = new CGI;
our @ISA = qw(CGI);

sub new {
    my ($class, $self) = @_;
    my $self = {};
    bless $self, $class;

The problem I find is that, I have and that I cant understand

#use CGI
# my $cgi = new CGI;
use htmlhandler;
my $h = new htmlhandler;

#print $cgi->header();
print $h->header();  #( This works )

#my @r = $cgi->param(); #( @r is populated )
my @r = $h->param(); # ( @r is NOT popuated )

print @r;

My understanding that through inheritance I can achieve to use the 
methods of CGI. As said header() works, but param() does not.

If someone can help me understand this, or please show me where I am 
going wrong, I would appreciate it.

Kind Regards
Brent Clark

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About