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

OO -> Cgi->param not working with inheritance

Thread Next
From:
Brent Clark
Date:
February 24, 2009 00:20
Subject:
OO -> Cgi->param not working with inheritance
Message ID:
49A3ADD5.8080807@gmail.com
Hiya

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About