CGI and other Objects 
Author Message
 CGI and other Objects

I have a little object called obj. When I create it( my $obj1 = new
obj(); ) using the one of the new methods listed below I get
dramatically diffferent results- like the fields are completely
incorrect in the first example. Would someone tell me why example one
doesn't work?

Thanks

sub new {
    my $self = shift;
    my $cgi = new CGI;
    $self = {
        MODE   => $cgi->param('mode'),
        ACTION => $cgi->param('action'),
        PILL       => $cgi->param('pill'),
    };
    bless $self;
    $self->showFields();

Quote:
}

sub new {
    my $self = shift;
    my $cgi = new CGI;
    $self = {
        MODE   => undef,
        ACTION => undef,
        PILL       => undef,
    };
    bless $self;
    $self->{MODE}   = $cgi->param('mode'),
    $self->{ACTION} = $cgi->param('action'),
    $self->{PILL}      = $cgi->param('pill'),
    $self->showFields();

Quote:
}

--
Cheers, dn


---------------------------------------------------------------
National Wilms Tumor Study Group                   206.667.4283
Seattle, WA



Fri, 14 Feb 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. package/object confuses each others variables?

2. new CGI objects in same CGI script

3. CGI object encapsulated functions

4. CGI::Object::uploads

5. In HTTP::Daemon: converting to CGI object

6. Storing the CGI object in my module?

7. Passing CGI objects to Modules.

8. Holding CGI file handle in object

9. CGI.pm Object help

10. CGI.pm objects

11. problem with Upload method of CGI object.

12. Multiple CGI objects

 

 
Powered by phpBB® Forum Software