instance of class into sub?

From: gep (98734_at_mail.muni.cz)
Date: 06/16/04


Date: Wed, 16 Jun 2004 17:52:25 GMT

How can i put cgi instance into sub?
i have main cgi script:
#!/usr/bin/perl -w
use CGI;
use strict;
use makepage;
...
my $cg=new CGI;
...
makepage->printhead($cg);
...

In makepage.pm is:
printhead {
   my $cg={};
   bless $cg, "CGI";
   ... #it is nice, e.g. $cg->url is OK, but whenever i try $cg->param,
it is empty
}

Don't anybody know, what to do whit this, many thanx, J. Slaby.



Relevant Pages

  • Re: new in CGI::Session::Driver::postgredsql nonexisting
    ... i would suggest you turn on strict and warnings in this example.. ... or die "cannot prepare"; ... use CGI ':standard'; ... sub makeHTML ...
    (comp.lang.perl.misc)
  • RE: Filering a file
    ... Nothing in your question is CGI ... # Open and compare lists of file. ... ## Always use strict. ...
    (perl.beginners)
  • Re: why to use 1)use CGI,2)use Strict ,3)use Carp in script
    ... The CGI.pm module is used in most cgi scripts, ... The 'strict' and 'warnings' pragmas should be used in all scripts ... The Carp module provides better report messages than the standard "die" ...
    (perl.beginners)
  • Re: search and replace help
    ... Declare variables in the smallest possible scope, ... This appears to be a CGI script. ... String comparisons require the string comparison operator, ... You have "use strict" in your code which ...
    (comp.lang.perl.misc)
  • Re: Form / CGI error
    ... > html form to a CGI ... > Let's focus on the script, not the HTML. ... >> use strict; ...
    (perl.beginners)