You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by CraigT <ct...@yahoo.com> on 2007/07/01 21:06:05 UTC

passing CGI paramters

Hello,

I'm trying to bring my application up using ModPerl::PerlRun.  I have
anchors at places in my code like <A CLASS='l2'
HREF='vumenu.cgi?str=$govlevel~$vufiles'  where I'm passing parameters to
the HREF.   It works under CGI, but when I try this under PerRun only the
parameters before the ~ come accross.   I've tried other separators that
work under CGI with the same effect under PerlRun.

Any guidance will be appreciated.   Thanks.

Respectfully,
CraigT 
-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11384626
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: Configuration Data vs. DirectoryIndex

Posted by "Marc M. Adkins" <Pe...@Doorways.org>.
Well, ref($self) returns the package name for the $self object, which is 
the class name passed into the call, which is 'Stuff'.  I double-checked 
by adding another warn() statement and re-running my test cases but it 
all checked out.  Unless I'm missing something.

Frank Wiles wrote:
> On Sat, 07 Jul 2007 11:13:49 -0700
> "Marc M. Adkins" <Pe...@Doorways.org> wrote:
> 
>> I have been struggling with DirectoryIndex behavior and configuration 
>> information from custom Perl directives for a while now.  I've been 
>> scanning the web and posting here and thanks for the previous
>> responses.
>>
>> I now have a solution that seems to work.  I have extracted a minimal 
>> set of tests that demonstrate the problem and my solution, which I
>> have attached as an archive (tar czf format).
>>
>> I'm not completely happy with my solution, mostly because I'm not
>> completely sure why it works -- or perhaps more to the point why it
>> is necessary.  I keep thinking that the mod_dir DirectoryIndex should
>> "just work" but of course that's bootless.  Either it doesn't in this 
>> situation or I don't understand something.
>>
>> I'd be pleased to have a better solution.  Or an explanation of why
>> this one works.  I have tried to reduce the problem to the smallest 
>> possible footprint to make it easy to review, for them what has the
>> time and interest.
> 
> 
>   In your code you're calling: 
> 
>   Apache2::Module::get_config( ref($self), .....other stuff....... )
> 
>   This isn't going to get you to pull in the right configuration
>   module you built.  I should be: 
> 
>   Apache2::Module::get_config( 'Stuff', .... other stuff...... )
> 
>   At least, if I'm understanding your problem correctly. 
> 
>  -------------------------------------------------------
>    Frank Wiles, Revolution Systems, LLC. 
>      Personal : frank@wiles.org  http://www.wiles.org
>      Work     : frank@revsys.com http://www.revsys.com 
> 
> 


Re: Configuration Data vs. DirectoryIndex

Posted by Frank Wiles <fr...@wiles.org>.
On Sat, 07 Jul 2007 11:13:49 -0700
"Marc M. Adkins" <Pe...@Doorways.org> wrote:

> I have been struggling with DirectoryIndex behavior and configuration 
> information from custom Perl directives for a while now.  I've been 
> scanning the web and posting here and thanks for the previous
> responses.
> 
> I now have a solution that seems to work.  I have extracted a minimal 
> set of tests that demonstrate the problem and my solution, which I
> have attached as an archive (tar czf format).
> 
> I'm not completely happy with my solution, mostly because I'm not
> completely sure why it works -- or perhaps more to the point why it
> is necessary.  I keep thinking that the mod_dir DirectoryIndex should
> "just work" but of course that's bootless.  Either it doesn't in this 
> situation or I don't understand something.
> 
> I'd be pleased to have a better solution.  Or an explanation of why
> this one works.  I have tried to reduce the problem to the smallest 
> possible footprint to make it easy to review, for them what has the
> time and interest.


  In your code you're calling: 

  Apache2::Module::get_config( ref($self), .....other stuff....... )

  This isn't going to get you to pull in the right configuration
  module you built.  I should be: 

  Apache2::Module::get_config( 'Stuff', .... other stuff...... )

  At least, if I'm understanding your problem correctly. 

 -------------------------------------------------------
   Frank Wiles, Revolution Systems, LLC. 
     Personal : frank@wiles.org  http://www.wiles.org
     Work     : frank@revsys.com http://www.revsys.com 


Re: Configuration Data vs. DirectoryIndex

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Marc M. Adkins wrote:
> I have been struggling with DirectoryIndex behavior and configuration
> information from custom Perl directives for a while now.  I've been
> scanning the web and posting here and thanks for the previous responses.
> 
> I now have a solution that seems to work.  I have extracted a minimal
> set of tests that demonstrate the problem and my solution, which I have
> attached as an archive (tar czf format).
> 
> I'm not completely happy with my solution, mostly because I'm not
> completely sure why it works -- or perhaps more to the point why it is
> necessary.  I keep thinking that the mod_dir DirectoryIndex should "just
> work" but of course that's bootless.  Either it doesn't in this
> situation or I don't understand something.
> 
> I'd be pleased to have a better solution.  Or an explanation of why
> this one works.  I have tried to reduce the problem to the smallest
> possible footprint to make it easy to review, for them what has the time
> and interest.
> 
> Failing that, perhaps this IS a good solution and may benefit some other
> poor soul.

it's probably just a misunderstanding on your part.  I'll take a look at
it, but I have absolutely no idea what your tarball actually does - that
it contains more than one .conf file is too complex for me to wade through.

try using this as a basis instead:

  http://people.apache.org/~geoff/Apache-Test-skeleton-mp2.tar.gz

if you can have 'make test' issue a failure that can be easily verified
I'm pretty sure I can explain what's going on.

see also

  http://marc.info/?l=apache-modperl&m=111335082632706&w=2

specifically

  http://marc.info/?l=apache-modperl&m=111461643218624&w=2

HTH

--Geoff



Configuration Data vs. DirectoryIndex

Posted by "Marc M. Adkins" <Pe...@Doorways.org>.
I have been struggling with DirectoryIndex behavior and configuration 
information from custom Perl directives for a while now.  I've been 
scanning the web and posting here and thanks for the previous responses.

I now have a solution that seems to work.  I have extracted a minimal 
set of tests that demonstrate the problem and my solution, which I have 
attached as an archive (tar czf format).

I'm not completely happy with my solution, mostly because I'm not
completely sure why it works -- or perhaps more to the point why it is 
necessary.  I keep thinking that the mod_dir DirectoryIndex should "just 
work" but of course that's bootless.  Either it doesn't in this 
situation or I don't understand something.

I'd be pleased to have a better solution.  Or an explanation of why
this one works.  I have tried to reduce the problem to the smallest 
possible footprint to make it easy to review, for them what has the time 
and interest.

Failing that, perhaps this IS a good solution and may benefit some other 
poor soul.

Marc M. Adkins

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
I know I'm not supposed to say thanks here.  But the open source/Perl
community has really impressed me with their willingness to help those less
knowledgeable.  Its nothing short of amazing in my experience. When I first
started the prototype work I've been doing, I called the public U. of Ky
Computer Science Department and asked if I could get a little guidance as I
was just transitioning into the WWW world.  The faculty I talked to ask me
if this was a consulting request.  When I responded that I had hoped to just
be able to ask a couple of questions, the person told me that they weren't
in the business of answering questions from the public without remuneration.  
I'm just an individual and could not afford their fees.   What a contrast.   
Thanks for the guidance and letting me learn from you all Perrin, Peter, and
Clinton over in Perl Monks, and everyone else that responded.   CraigT



Perrin Harkins wrote:
> 
> On 7/6/07, CraigT <ct...@yahoo.com> wrote:
>> In this regard though, I would
>> like to ask what you recommend to pass back several paramters from a sub
> 
> The usual way to do it is to accept a list of return values:
> 
> my ($foo, $bar) = sub_call($param);
> 
>> I'd like to focus on this problem here because I don't feel like I have
>> much
>> control between the anchor click and the retrival of the paramters in the
>> invoked module.
> 
> You don't have any control of that.  That's handled by the web browser
> and your operating system.  We just assume that part works.  I don't
> think the problem is there.
> 
>> I haven't shown the code because I'm not quite sure how.
> 
> The best thing to do is to try to make a small example program that
> shows the problem.  Sometimes, just by trying to make a small example
> of it, you fix the problem.
> 
>> The first module presented is m3.cgi.
> 
> This code has some problems.  This isn't a general Perl help mailing
> list, but I'll point out a couple of quick things.  I also recommend
> that you buy a copy of "Perl Best Practices" and join
> http://perlmonks.org/ in order to have a community of people to help
> you with general Perl questions.
> 
>> use strict;
> 
> Use warnings too.
> 
>> (my $ai, my $row, my $r, my $col, my $c, my $cpos, my $blankx, my $lstr,
>> my
>> $xlnklen, my $zzx, my $firstcpos) = "";
> 
> This kind of initialization isn't necessary.  It's better to declare
> your variables right before you use them, to keep the scope as small
> as possible.  The way you're initializing them here won't work anyway,
> since you only have one empty string, and a list of variables on the
> left.
> 
>> # Get document root and server name.
>>
>> foreach $key (sort keys(%ENV)) {
>>       if ($key eq 'DOCUMENT_ROOT') {
>>         $docroot = $ENV{$key};
>>       }
>>
>>       if ($key eq 'SERVER_NAME') {
>>         $servname = $ENV{$key};
>>       }
>> }
> 
> That should just be
>   $docroot       = $ENV{DOCUMENT_ROOT};
>   $servername = $ENV{SERVER_NAME};
> 
>> open(ORG,"<$orgidfn");
>> flock(ORG,LOCK_SH);
>> @glines = <ORG>;
>> close(ORG);
> 
> Any time you open, flock, or close, you must check for errors with the
> usual "or die" construct.
> 
>>   print "Content-type:  text/html\n\n";
> 
> Use $page->header() instead.
> 
>>   print "<HTML><HEAD><TITLE>$gov Efforts</TITLE>
> 
> A templating system might make this HTML easier for you to deal with.
> You could start with something simple, like Text::Template.
> 
>> # Get the paramters from the calling program - shoidls.cgi.
>>
>> $govlevel = $page->param("str");
> 
> I don't see anything wrong with this, or with the call where you
> created $page, above.  Put in a "warn $govlevel" there and see if it's
> what you think it should be.  If it is, manually change the value of
> str in the URL in your browser and try it again, checking to see if
> the variable changes too.
> 
>> If I preload (compile) my application programs into the Apache registry
>> as I
>> hope to, when I execute under CGI I'm thinking those copies will be used
>> if
>> I have the correct handler (like the one below) in my Apache httpd?
> 
> Well, you won't be executing under CGI, but if you configure Registry
> to handle your URLs and you preload scripts for those URLs, they will
> be used.  Your configuration is not correct though.  Apache::Registry
> is mod_perl 1.  Maybe you meant to say ModPerl::Registry?
> 
>> I
>> haven't found a package for Apache::RegistryLoader yet and may have to
>> get
>> it form CPAN.
> 
> No, ModPerl::RegistryLoader comes with mod_perl 2.
> 
>> And when I transition to PerlRun and mod_perl, my
>> understanding is that I should preload the application programs into the
>> ModPerl::Registry?
> 
> You don't really have to preload anything.  It may save you some
> memory, but it's not important at this point.  Wait until your code is
> working to worry about things like that.
> 
>> If I preload the Perl modules I'm using, do I still need to 'Use' those
>> modules in my application programs?
> 
> You don't technically have to, but it's a good practice to do it
> anyway, to make it clear which modules depend on which others and make
> it easier to work with later.
> 
> - Perrin
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11478312
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
On 7/6/07, CraigT <ct...@yahoo.com> wrote:
> In this regard though, I would
> like to ask what you recommend to pass back several paramters from a sub

The usual way to do it is to accept a list of return values:

my ($foo, $bar) = sub_call($param);

> I'd like to focus on this problem here because I don't feel like I have much
> control between the anchor click and the retrival of the paramters in the
> invoked module.

You don't have any control of that.  That's handled by the web browser
and your operating system.  We just assume that part works.  I don't
think the problem is there.

> I haven't shown the code because I'm not quite sure how.

The best thing to do is to try to make a small example program that
shows the problem.  Sometimes, just by trying to make a small example
of it, you fix the problem.

> The first module presented is m3.cgi.

This code has some problems.  This isn't a general Perl help mailing
list, but I'll point out a couple of quick things.  I also recommend
that you buy a copy of "Perl Best Practices" and join
http://perlmonks.org/ in order to have a community of people to help
you with general Perl questions.

> use strict;

Use warnings too.

> (my $ai, my $row, my $r, my $col, my $c, my $cpos, my $blankx, my $lstr, my
> $xlnklen, my $zzx, my $firstcpos) = "";

This kind of initialization isn't necessary.  It's better to declare
your variables right before you use them, to keep the scope as small
as possible.  The way you're initializing them here won't work anyway,
since you only have one empty string, and a list of variables on the
left.

> # Get document root and server name.
>
> foreach $key (sort keys(%ENV)) {
>       if ($key eq 'DOCUMENT_ROOT') {
>         $docroot = $ENV{$key};
>       }
>
>       if ($key eq 'SERVER_NAME') {
>         $servname = $ENV{$key};
>       }
> }

That should just be
  $docroot       = $ENV{DOCUMENT_ROOT};
  $servername = $ENV{SERVER_NAME};

> open(ORG,"<$orgidfn");
> flock(ORG,LOCK_SH);
> @glines = <ORG>;
> close(ORG);

Any time you open, flock, or close, you must check for errors with the
usual "or die" construct.

>   print "Content-type:  text/html\n\n";

Use $page->header() instead.

>   print "<HTML><HEAD><TITLE>$gov Efforts</TITLE>

A templating system might make this HTML easier for you to deal with.
You could start with something simple, like Text::Template.

> # Get the paramters from the calling program - shoidls.cgi.
>
> $govlevel = $page->param("str");

I don't see anything wrong with this, or with the call where you
created $page, above.  Put in a "warn $govlevel" there and see if it's
what you think it should be.  If it is, manually change the value of
str in the URL in your browser and try it again, checking to see if
the variable changes too.

> If I preload (compile) my application programs into the Apache registry as I
> hope to, when I execute under CGI I'm thinking those copies will be used if
> I have the correct handler (like the one below) in my Apache httpd?

Well, you won't be executing under CGI, but if you configure Registry
to handle your URLs and you preload scripts for those URLs, they will
be used.  Your configuration is not correct though.  Apache::Registry
is mod_perl 1.  Maybe you meant to say ModPerl::Registry?

> I
> haven't found a package for Apache::RegistryLoader yet and may have to get
> it form CPAN.

No, ModPerl::RegistryLoader comes with mod_perl 2.

> And when I transition to PerlRun and mod_perl, my
> understanding is that I should preload the application programs into the
> ModPerl::Registry?

You don't really have to preload anything.  It may save you some
memory, but it's not important at this point.  Wait until your code is
working to worry about things like that.

> If I preload the Perl modules I'm using, do I still need to 'Use' those
> modules in my application programs?

You don't technically have to, but it's a good practice to do it
anyway, to make it clear which modules depend on which others and make
it easier to work with later.

- Perrin

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
I realize that I have some redoing to do in relation to the scope/closure
stuff to make the PerlRun/mod_perl transition, and thanks to you all I have
a pretty good idea of what I have to do.   In this regard though, I would
like to ask what you recommend to pass back several paramters from a sub
(question 1)?

What I would like to focus on is the problem I'm havin passing paramters
between programs (question 2).  I asked before if I should be able to see
the correct passed parameters when I pull them across to the module invoked
by the anchor prior to entering a sub in that module (my > $page = new
CGI;$params = $page->param("str");)?  Perrin said Yes, even if y ou have a
scoping problem, code that is in the "main" part of your script, outside of
subs, should be able to see the correct values.

But the stuff is not coming across correctly.   I've verified that the stuff
I pass from m3 is correct.   But if I click on the ss.cgi or vumenu.cgi
anchor 1st and then the other, the other gets passed the paramters of the
first.  The 'str' variable, used to pass the paramters to both, persists
until I recycle the server.   I changed the name of 'str' in the anchors and
each invoked module to make it unique for each module to see if this would
help.  When I did this, the anchor I hit first worked and the second got no
paramters at all.  And the code works right under CGI.   

I'd like to focus on this problem here because I don't feel like I have much
control between the anchor click and the retrival of the paramters in the
invoked module. 

I haven't shown the code because I'm not quite sure how.    That code I
posted before was an atempt to show what I thought might be enough.    The
whole modules are alot to show here.   But I'll give it a 2nd try by posting
more but not all.   

The first module presented is m3.cgi.   I've included the code for this
module down to the anchors that execute ss.cgi and vumenu.cgi at the bottom
of what I've presented for the m3.cgi program.  I've included code from the
2nd module (ss.cgi) down to where the parameters are brought across.   The
code I've included for both modules is in the main portion of each.  The
code for the 2 programs follows.


#####################Beginning of m3.cgi

#!C:/PERL/bin/perl.exe  -w


# Show Model 3 (top level - 1 application installation - copy of level3i)



# Bring in resources.

use strict;
use CGI;
use Getopt::Std;
use File::Copy;
use File::Basename;
use Fcntl qw(:flock);
use Time::Local;
use MongerFile;
use Image::Size;


# Bring client data in.

my $page = new CGI;


# Data space declarations.

# Set to enable/disable totaling calculations.

my $shototltots = 1;
my $shocoltots = 1;
my $shorowtots = 1;
my $shocelltots = 1;

my $celsz = 6; # Number of efforts per cell allowed.

my $county = 0; # 1=county level implementation/0=other

my $databasedir = "C:/Steep/USA Data/"; # Base data directory.


(my $ai, my $row, my $r, my $col, my $c, my $cpos, my $blankx, my $lstr, my
$xlnklen, my $zzx, my $firstcpos) = "";
(my $idesc, my $imeas, my $cnd, my $chg, my $iline, my $xstr, my $xstr2, my
$xs, my $xs2, my $xss2, my $xss3) = "";
(my $dval, my $cmpval, my $pfn, my $pline, my $pnm, my $expd, my $itok, my
$expdem, my $xxfn1, my $xxfn2) = "";
(my $alltots, my $xlnk, my $cnum, my $hdr, my $pic, my $yr, my $mess, my
$viewflg, my $vufiles, my $iferrmsg) = "";
(my $gov, my $govcat, my $govlevel, my $exlevel, my @glines, my $gstr, my
$bogie, my $xcho, my $gotcpos1, my $dn) = "";
(my $sta, my $stri, my $inv, my $tmp, my $match, my $l, my $thedem, my
$orgidfn, my $idlfn, my $govfn, my $dn1) = "";  
(my $cname, my $ctitle, my $cphone, my $cemail, my $dirx, my $oid, my
$docroot, my $servname, my $key, my $dn2) = "";

# Default colors - see custom.parms for color explanations.

my $appbgcolr = 'E6ECFF'; # Screen colors.
my $banrcolr = '809FFF';
my $ltappbgcolr = 'F8F8FF';
my $whitetext = 'FFFFFF';
my $darkbluetext = '000099';
my $inputupdfieldbg = '99CCFF'; # Input/update content entry field
background.
my $anchorcolr = '000099';
my $anchorhovercolr = '0000FF';
my $m3boundrycellbg = '809FFF';
my $m3row1 = 'Sociocultural'; # Model 3 effort row headers.
my $m3row2 = 'Technological';
my $m3row3 = 'Economic';
my $m3row4 = 'Environmental';
my $m3row5 = 'Political';
my $m3row6 = 'Organizational'; # Optional model 3 row.

(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my
$isdst,my $cntxx,my $capsx,my $smlsx) = 0;
(my $i, my $j, my $icnt, my $jcnt, my $celcnt, my $snum, my $dolrdem, my
$cmpdolr, my $cordolr, my $celpos) = 0; 
(my $totcnd, my $totchg, my $totexp, my $cndacc, my $chgacc, my $expacc, my
$t1, my $t2, my $t3, my $padlen) = 0;
(my $wid, my $ht, my $wid1, my $ht1, my $wid2, my $ht2, my $didit) = 0;
(my $thou, my $mil, my $bil, my $tril) = (1000, 1000000, 1000000000,
1000000000000);

my @caps =
('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); 
my @smls =
('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); 
my @aspects = ("$m3row1", "$m3row2", "$m3row3", "$m3row4", "$m3row5",
"$m3row6"); # Row Headers.
(my @ilines, my @plines, my @hldie1, my @hldie2, my @bt, my @hldem, my
@rtots, my @ctots, my %menuind, my @vustf) = ();


# Get document root and server name.

foreach $key (sort keys(%ENV)) {
      if ($key eq 'DOCUMENT_ROOT') {
        $docroot = $ENV{$key};
      }

      if ($key eq 'SERVER_NAME') {
        $servname = $ENV{$key};
      }
}


# Get government level from ID file and set level indicator.

$orgidfn = "$docroot/org3.ID";

$iferrmsg = "Problem opening ".$orgidfn.".";
open(ORG,"<$orgidfn"); 
flock(ORG,LOCK_SH);
@glines = <ORG>;
close(ORG);
chomp(@glines);

$gov = $glines[2];
$govcat = $glines[1];
$govlevel = $govcat . $gov;
$exlevel = 'level3'; # Execution model.

my $accessfrom = "http://" . $servname . "/stage/$gov/";
my $putto = $docroot . "/stage/$gov/";


# Construct file names and directory base.

my $thedir = " ";
if ($govcat eq "F") {  
  $idlfn = $databasedir."Federal/".$gov."/Ideals/ideals.dat";
  $govfn = $databasedir."Federal/".$gov."/gov.dat";
  $thedir = $databasedir."Federal/".$gov."/"; 
} elsif ($govcat eq "S") {
    $idlfn = $databasedir."State/".$gov."/Ideals/ideals.dat";
    $govfn = $databasedir."State/".$gov."/gov.dat";
    $thedir = $databasedir."State/".$gov."/";
  } elsif ($govcat eq "R") {
      $idlfn = $databasedir."Regional/".$gov."/Ideals/ideals.dat";
      $govfn = $databasedir."Regional/".$gov."/gov.dat";
      $thedir = $databasedir."Regional/".$gov."/";
    } else {
        $idlfn = $databasedir."UrbanLocal/".$gov."/Ideals/ideals.dat";
        $govfn = $databasedir."UrbanLocal/".$gov."/gov.dat";
        $thedir = $databasedir."UrbanLocal/".$gov."/";
      }


# Load and set custom parameters.

my $cpsfnx = $thedir . 'custom.parms';
if (-e $cpsfnx) {

  $iferrmsg = "Problem opening ".$cpsfnx."."; # Custom parameters.
  open(CPS,"<$cpsfnx");
  flock(CPS, LOCK_SH); 
  my @cpslnsx = <CPS>;
  close(CPS);
  chomp(@cpslnsx);

  my $cpsln = '';
  foreach $cpsln (@cpslnsx) {
    if (index($cpsln,'#') > 1) {
      ($cpsln,$tmp) = split ('#',$cpsln);
    }
    eval($cpsln);
  }

}


# Only do if the needed data files are there.

if (-e $govfn && -e $idlfn) {

  # Load government description data.

  $iferrmsg = "Problem opening ".$govfn.".";
  open(XGOV,"<$govfn"); 
  flock(XGOV,LOCK_SH);
  @glines = <XGOV>;
  close(XGOV);
  chomp(@glines);

  my @endvs = split (/:/, $glines[6]); # Get number of endeavors/columns.
  my $colnm = @endvs; # Number of endeavors.

  my @lnks = split (/:/, $glines[4]); #Get Yesterday, Today, and Tomprrow
links.
  $lnks[0] = $lnks[0] . ':' . $lnks[1];
  $lnks[1] = $lnks[2] . ':' . $lnks[3];
  $lnks[2] = $lnks[4] . ':' . $lnks[5];

  # Add organization aspect if required.

  my $rownm = 5; # Characters in STEEP.
  if ($glines[7] eq "y") {
    $rownm = 6; # STEEPO.
  }

  # Load ideals/efforts.

  $iferrmsg = "Problem opening ".$idlfn.".";
  open(IDLS,"<$idlfn");
  flock(IDLS, LOCK_SH);
  @ilines = <IDLS>;
  close(IDLS);
  my $idlnm = @ilines; # number of ideals
  chomp(@ilines);

  # Roll up efforts with submenus.  
 
  &rollup;

  
  # Find views.

  $viewflg = 0;
  @vustf = <"$thedir*.view">;
  my $vunm = @vustf;
  if ($vunm > 0) {
    $viewflg = 1;
    $vufiles = join ('!',@vustf);
  } else {
      $county = 1; # No special views.
    } 


  # Set the column/row width.

  my $colwid = 225;
  if ($colnm == 4) {
    $colwid = 190;
  }

  my $rowht = 76;
  if ($rownm == 6) {
    $rowht = 65;
  }
  

  ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); #
Get the year.
  $year = $year + 1900; # Current year.


  $xs = $thedir . lc($gov) . "2.gif"; # Put organization GIF 2 in GIF
staging area.
  my $orgimg = $xs; 
  $xss2 = $putto . $gov . "2.gif"; 
  $xss3 = $accessfrom . $gov . "2.gif";

  $xxfn1 = $xs;
  $xxfn2 = $xss2;
  &cftsain; # Copy file to staging area if needed.


  $xstr = $govlevel . ':' . $exlevel;
  $lstr = " steepcm2.cgi?caller=$xstr  ../images/Image10.gif  &nbspPresented
By ©  javascript:mailx() iSTEEPi 
http://steepusa.no-ip.info/cgi-bin/cntinvoks.cgi?mod=m3 ";
  

  # Do welcome stuff.
  
  my $zzx = '';
  my $zzx2 = '';
  my $zzx3 = '';
  if(index($glines[5],';') > -1) { 
    (my $bog, my $wstf) = split(';', $glines[5]);
    
    my @wstf = ();
    @wstf = split('-', $wstf);

    if(index($wstf[1],'http://') == -1) {      
      $zzx = $thedir . $wstf[1];
      ($wid, $ht) = imgsize("$zzx"); # Scale small image proportionately.
      &dodims;
      $wid2 = $wid;
      $ht2 = $ht;
      $dn2 = $dn;  
      $zzx2 = $putto .  $wstf[1];
      $zzx3 = $accessfrom . $wstf[1];

      $xxfn1 = $zzx;
      $xxfn2 = $zzx2;
      &cftsain; # Copy file to staging area if needed.
      
      $zzx = "&nbsp&nbsp&nbsp $zzx3 ";
    } else {
        $zzx = $thedir . $wstf[2];
        ($wid, $ht) = imgsize("$zzx"); # Scale small image proportionately.
        &dodims;
        $wid2 = $wid;
        $ht2 = $ht;
        $dn2 = $dn;
        $zzx2 = $putto .  $wstf[2];
        $zzx3 = $accessfrom . $wstf[2];
 
        $xxfn1 = $zzx;
        $xxfn2 = $zzx2;
        &cftsain; # Copy file to staging area if needed.

        $zzx = "&nbsp&nbsp&nbsp $wstf[1]  $zzx3  "; 
      }      
  }

  ($wid, $ht) = imgsize("$orgimg"); # Scale small image proportionately.
  &dodims;
  $wid1 = $wid;
  $ht1 = $ht;
  $dn1 = $dn;    

  
  print "Content-type:  text/html\n\n";

  print "<HTML><HEAD><TITLE>$gov Efforts</TITLE>

         <STYLE>

              #A {
                  COLOR:\"#$whitetext\";
                  FONT-SIZE:14pt;
                  BACKGROUND-COLOR:\"#$banrcolr\";
                  TEXT-ALIGN:LEFT;
                  FONT-WEIGHT:LESS BOLD;          
                 }
              #B {
                  COLOR:\"#$darkbluetext\";
                  FONT-FAMILY:'Times New Roman';                   
                  FONT-SIZE:'12pt';
                 }      

              BODY {
                    BACKGROUND-COLOR:\"#$appbgcolr\";
                    TEXT-ALIGN:CENTER;
                    COLOR:\"#$darkbluetext\";
                    FONT-SIZE:'14PT';
                   }              

              TD.EA {
                     BACKGROUND-COLOR:'#$m3boundrycellbg';                     
                     TEXT-ALIGN:CENTER;
                     FONT-SIZE:'12PT';
                     COLOR:\"#$darkbluetext\";
                     FONT-WEIGHT:BOLD;                                          
                    }
              TD.ENDV {
                       BACKGROUND-COLOR:\"#$m3boundrycellbg\";
                       TEXT-ALIGN:CENTER;
                       FONT-SIZE:'12PT';
                       COLOR:\"#$whitetext\";
                       FONT-WEIGHT:BOLD; 
                      }
              TD.ASPC {
                       BACKGROUND-COLOR:\"#$m3boundrycellbg\";                       
                       TEXT-ALIGN:CENTER;
                       FONT-SIZE:'12PT';
                       COLOR:\"#$whitetext\";
                       FONT-WEIGHT:BOLD;
                      }
              TD.CELL {
                       BACKGROUND-COLOR:\"#$ltappbgcolr\";
                       TEXT-ALIGN:LEFT;
                       FONT-SIZE:'7PT';
                       FONT-FAMILY:'Tahoma';                  
                       COLOR:\"#$darkbluetext\";
                       VERTICAL-ALIGN:TOP;
                      }              
                   
              A {
                 color:\"#$anchorcolr\";
                 FONT-SIZE:'7PT';
                 FONT-WEIGHT:LIGHTER;
                }
              A.l2 {
                    color:\"#$anchorcolr\";
                    FONT-SIZE:'10PT';
                    FONT-WEIGHT:LIGHTER;
                   }
              A.l3 {
                    color:\"#$anchorcolr\";
                    FONT-SIZE:'12px';
                    FONT-WEIGHT:LIGHTER;                                        
                   }  
              
              A:hover {color:\"#$anchorhovercolr\"}
              
              .tn img { border:0 }
              .tn         { border: 0px solid #0000FF; }	      
	      .tn:hover   { border: 0px solid #660099; }

              .Fbox { BACKGROUND-COLOR:\"#$appbgcolr\"; width: 8%; position:
absolute; top: \"$dn1\"; left: 1px;FONT-SIZE:'10PT';text-indent:38px}  
              .Bbox { BACKGROUND-COLOR:\"#$appbgcolr\"; TEXT-ALIGN:LEFT;
width: 10%; position: absolute; top: \"$dn2\"; left: 90%;FONT-SIZE:'10PT';}   
                
              #postit{
                      position:absolute;
                      width:255;
                      padding:5px;
                      background-color:\"#$ltappbgcolr\";
                      border:1px solid navy;
                      visibility:hidden;
                      z-index:100;
                      cursor:hand;
                     }
                 
         </STYLE>

         <SCRIPT language='JavaScript' type='text/javascript'>

            function mailx() {    
             
parent.location.href='mailto:steepusa'+'\@'+'yahoo.com'+'?subject= ';   
            } // Mail steepusa.


            // Postit functions.

            function showornot() {
              document.all.postit.style.visibility='visible';
            }

            function closeit() {
              document.all.postit.style.visibility='hidden';
            }

         </SCRIPT>

         </HEAD>\n";
 
  print "<BODY>\n";  

  print "  <FORM NAME='ShoIdls' >\n"; 

  my $dblnk = '';
  my $dbfn = $thedir . 'app.ki';
  my $dbimg = '../images/cdev.gif';
  if (-e $dbfn) {
    $dblnk = "&nbsp&nbsp dashboard.cgi?str=$govlevel:3  $dbimg  ";
  } 

  if ($zzx ne '') {
    print"<BR><div CLASS='Fbox'> $xss3 &nbsp&nbsp&nbsp&nbsp</div><div
ID='A'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$glines[0]
Efforts<sup style='font-size:12px'> javascript:showornot() ? </sup> -
$year$dblnk</div><div CLASS='Bbox'>&nbsp$zzx</div>\n";
  } else {
      print"<BR><div CLASS='Fbox'> $xss3 &nbsp&nbsp&nbsp&nbsp</div><div
ID='A'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$glines[0]
Efforts<sup style='font-size:12px'> javascript:showornot() ? </sup> -
$year$dblnk</div>\n";
    }


  print "    <DIV style='font-size:10pt'>\n"; 

  if ($county) {
    print
"<BR><BR>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
ss.cgi?str=$govlevel Sights/Sounds
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[0] Yesterday
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[1] Today
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[2] Tommorow
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$lstr\n";
# Table title and links.

  } else { 
      print
"<BR><BR>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
ss.cgi?str=$govlevel Sights/Sounds
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[0] Yesterday
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[1] Today
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
$lnks[2] Tommorow
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
vumenu.cgi?str=$govlevel~$vufiles Special Views
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$lstr\n";
# Table title and links. 

    }



#####################ss.cgi begins here

#!C:/PERL/bin/perl.exe  -w

# Copyright © iSTEEPi 2004-2005 - All Rights Reserved 

# Present Organization Sights and Sounds (called from model 2 and 3)



# Bring in resources.

use strict;
use CGI;
use Getopt::Std;
use File::Copy;
use File::Basename;
use Fcntl qw(:flock);
use MongerFile;
use Image::Size;


# Bring client data in.

my $page = new CGI;


# Datatype declarations.

my $databasedir = "C:/Steep/USA Data/"; # Base data directory.

(my $mess, my $lnk, my $govstf, my $govlevel, my $govcat, my $gov, my
$govfn, my $dn, my $xxfn1) = "";
(my $xs, my $xss2, my $xss3, my $docroot, my $servname, my $key, my $tmp, my
$iferrmsg, my $xxfn2) = "";

# Default colors - see custom.parms for color explanations.

my $appbgcolr = 'E6ECFF'; # Screen colors.
my $banrcolr = '809FFF';
my $ltappbgcolr = 'F8F8FF';
my $whitetext = 'FFFFFF';
my $darkbluetext = '000099';

my $ht = 0; # Common image height and width 1 and 2.
my $wid = 0;
my $ht2 = 0; 
my $wid2 = 0;

(my @govstf, my @ss, my @xlnk, my @img) = ();


# Get the document root and server name.

foreach $key (sort keys(%ENV)) {
      if ($key eq 'DOCUMENT_ROOT') {
        $docroot = $ENV{$key};
      }

      if ($key eq 'SERVER_NAME') {
        $servname = $ENV{$key};
      }
}


# Get the paramters from the calling program - shoidls.cgi.

$govlevel = $page->param("str");
$govcat = substr($govlevel,0,1);
$gov = substr($govlevel,1,length($govlevel)-1);

  
This concludes the code for the 2 programs - m3.cgi and ss.cgi.


Question 3 and 4.
If I preload (compile) my application programs into the Apache registry as I
hope to, when I execute under CGI I'm thinking those copies will be used if
I have the correct handler (like the one below) in my Apache httpd?   I
haven't found a package for Apache::RegistryLoader yet and may have to get
it form CPAN.  And when I transition to PerlRun and mod_perl, my
understanding is that I should preload the application programs into the
ModPerl::Registry?

PerlModule Apache::Registry
Alias /cgi-bin/ "/usr/www/steepusa/cgi-bin/"
  <Location /cgi-bin>
     SetHandler perl-script
     PerlResponseHandler Apache::Registry
     Options +ExecCGI     
     PerlOptions +ParseHeaders
  </Location>


Question 5.
If I preload the Perl modules I'm using, do I still need to 'Use' those
modules in my application programs? 

CraigT



Perrin Harkins wrote:
> 
> On 7/6/07, CraigT <ct...@yahoo.com> wrote:
>> Am I passing the paramters in the anchor
>> examples I presented earlier as I should using PerlRun or mod_perl?
> 
> I don't think you ever showed us the code.  You just showed the code
> where you print the HTML.  If you can show us a complete sub and how
> you call it, we can tell you if it looks right.
> 
>> Should
>> I be able to see the correct passed parameters when I pull them across to
>> the module invoked by the anchor prior to entering a sub in that module
>> (my
>> $page = new CGI;$params = $page->param("str");)?
> 
> Yes, even if y ou have a scoping problem, code that is in the "main"
> part of your script, outside of subs, should be able to see the
> correct values.
> 
>> If a subroutine needs many
>> parameters, how would you recommend they be passed?
> 
> Use a hash:
> 
> foo(x => 1, y => 2);
> 
> sub foo {
>     my %args = @_;
>     print $args{x}, $args{y};
> 
>> After simply installing
>> mod_perl, am I using the Apache embedded Perl interpreter or do I have to
>> make the transition to PerlRun or mod_perl for this to occur?
> 
> You have to use PerlRun or some other mod_perl handler.
> 
> - Perrin
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11475056
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
On 7/6/07, CraigT <ct...@yahoo.com> wrote:
> Am I passing the paramters in the anchor
> examples I presented earlier as I should using PerlRun or mod_perl?

I don't think you ever showed us the code.  You just showed the code
where you print the HTML.  If you can show us a complete sub and how
you call it, we can tell you if it looks right.

> Should
> I be able to see the correct passed parameters when I pull them across to
> the module invoked by the anchor prior to entering a sub in that module (my
> $page = new CGI;$params = $page->param("str");)?

Yes, even if y ou have a scoping problem, code that is in the "main"
part of your script, outside of subs, should be able to see the
correct values.

> If a subroutine needs many
> parameters, how would you recommend they be passed?

Use a hash:

foo(x => 1, y => 2);

sub foo {
    my %args = @_;
    print $args{x}, $args{y};

> After simply installing
> mod_perl, am I using the Apache embedded Perl interpreter or do I have to
> make the transition to PerlRun or mod_perl for this to occur?

You have to use PerlRun or some other mod_perl handler.

- Perrin

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
A few more questions please.  Am I passing the paramters in the anchor
examples I presented earlier as I should using PerlRun or mod_perl?   Should
I be able to see the correct passed parameters when I pull them across to
the module invoked by the anchor prior to entering a sub in that module (my
$page = new CGI;$params = $page->param("str");)?  If a subroutine needs many
parameters, how would you recommend they be passed?  After simply installing
mod_perl, am I using the Apache embedded Perl interpreter or do I have to
make the transition to PerlRun or mod_perl for this to occur?

CraigT 

    

Michael Peters wrote:
> 
> CraigT wrote:
>> Perrin,
>> 
>> Is what I'm hearing you say is that in the PerlRun environment (and I'm
>> guessing the mod_perl environment too), anything that a subroutine uses
>> coming from outside that code must be passed as a parameter like
>> '&sub($paramter)'.   Am I correct in this.    
> 
> Yes and no. The key to understanding this under mod_perl is that global
> variables and packaged scoped variables do not get reinitialized for each
> request like they do under normal CGI.
> 
> So if you are using a global var that should retain state between
> requests, then
> no you don't need to pass it to each subroutine. But if you're not, then
> yes you do.
> 
> And btw, you don't need the '&' in front of the the sub.
> 
>   sub($paramter)
> 
> is the proper way to do it.
> 
>> Associating the words scope and closure helped.   I know scope well
>> although
>> different languages implement the idea differently.   I had not heard the
>> word closure before or had not understood it as scope.
> 
> While related, they aren't the same thing. A closure is a function that
> "remembers" it's lexical environment when compiled. So it can reference
> things
> that were declared in the same scope as it self.
> 
> http://en.wikipedia.org/wiki/Closure_%28computer_science%29
> and in Perl
> http://www.perl.com/pub/a/2002/05/29/closure.html
> 
> Depending on the other languages you know, you might never have
> encountered a
> closure before since they don't exist in languages like C, C++ or Java.
> 
> -- 
> Michael Peters
> Developer
> Plus Three, LP
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11465053
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Michael Peters <mp...@plusthree.com>.
CraigT wrote:
> Perrin,
> 
> Is what I'm hearing you say is that in the PerlRun environment (and I'm
> guessing the mod_perl environment too), anything that a subroutine uses
> coming from outside that code must be passed as a parameter like
> '&sub($paramter)'.   Am I correct in this.    

Yes and no. The key to understanding this under mod_perl is that global
variables and packaged scoped variables do not get reinitialized for each
request like they do under normal CGI.

So if you are using a global var that should retain state between requests, then
no you don't need to pass it to each subroutine. But if you're not, then yes you do.

And btw, you don't need the '&' in front of the the sub.

  sub($paramter)

is the proper way to do it.

> Associating the words scope and closure helped.   I know scope well although
> different languages implement the idea differently.   I had not heard the
> word closure before or had not understood it as scope.

While related, they aren't the same thing. A closure is a function that
"remembers" it's lexical environment when compiled. So it can reference things
that were declared in the same scope as it self.

http://en.wikipedia.org/wiki/Closure_%28computer_science%29
and in Perl
http://www.perl.com/pub/a/2002/05/29/closure.html

Depending on the other languages you know, you might never have encountered a
closure before since they don't exist in languages like C, C++ or Java.

-- 
Michael Peters
Developer
Plus Three, LP


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
On 7/5/07, CraigT <ct...@yahoo.com> wrote:
> Is what I'm hearing you say is that in the PerlRun environment (and I'm
> guessing the mod_perl environment too), anything that a subroutine uses
> coming from outside that code must be passed as a parameter like
> '&sub($paramter)'.   Am I correct in this.

Unless you are trying to create a variable that never changes, yes.
This is true in all perl code, not just mod_perl.  You don't notice
the effect in CGI because the interpreter exits.  This is a general
good practice for programming -- you want subroutines to be
independent and have no side effects on variables that are not passed
to them.

- Perrin

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
Perrin,

Is what I'm hearing you say is that in the PerlRun environment (and I'm
guessing the mod_perl environment too), anything that a subroutine uses
coming from outside that code must be passed as a parameter like
'&sub($paramter)'.   Am I correct in this.    

Associating the words scope and closure helped.   I know scope well although
different languages implement the idea differently.   I had not heard the
word closure before or had not understood it as scope.

CraigT

  

Perrin Harkins wrote:
> 
> On 7/4/07, CraigT <ct...@yahoo.com> wrote:
>> In each of the modules, I bring 'str' across with something like my
>> $somevar
>> = $page->param("str") assigning the paramter values to a declared Perl
>> variable.
> 
> Okay, but do you pass $page explicitly to the sub, or do you just
> define it outside the sub and use it?  If it's the latter, you have a
> closure problem.
> 
>> The problem is that what is coming across from the
>> invoking module to the invoked module is incorrect.
> 
> That sounds like a closure problem, where the sub can only see the
> original version of $page.
> 
>> the value of 'str' set in the first invocation
>> persists such that the invocation of the other 2 anchors has the 'str'
>> values from the first invocation.
> 
> That sounds like a closure problem too.
> 
>> And
>> again, it works fine under CGI.
> 
> That sounds like a closure problem too.  You never notice that your
> code has a scoping bug (which is what a closure problem is) in CGI
> because the process exits immediately, and the cached value never gets
> used again.
> 
>> Also, the ENV variables I had in my scratchpad where mistakenly executed
>> under CGI.
> 
> Good, then I think all the mysteries are solved.
> 
>> I would like to understand better the 'no longer shared' message in the
>> error log.
> 
> That's a message that you get when you have closure problem.  It means
> the variable will be cached the first time through and never change
> again.
> 
> All that you need to do to fix this problem is to pass all of the
> variables that your sub needs to the sub when you call it.  If you
> don't understand what I mean, post one of your subs and we'll show you
> how to change it.
> 
> - Perrin
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11448994
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
On 7/4/07, CraigT <ct...@yahoo.com> wrote:
> In each of the modules, I bring 'str' across with something like my $somevar
> = $page->param("str") assigning the paramter values to a declared Perl
> variable.

Okay, but do you pass $page explicitly to the sub, or do you just
define it outside the sub and use it?  If it's the latter, you have a
closure problem.

> The problem is that what is coming across from the
> invoking module to the invoked module is incorrect.

That sounds like a closure problem, where the sub can only see the
original version of $page.

> the value of 'str' set in the first invocation
> persists such that the invocation of the other 2 anchors has the 'str'
> values from the first invocation.

That sounds like a closure problem too.

> And
> again, it works fine under CGI.

That sounds like a closure problem too.  You never notice that your
code has a scoping bug (which is what a closure problem is) in CGI
because the process exits immediately, and the cached value never gets
used again.

> Also, the ENV variables I had in my scratchpad where mistakenly executed
> under CGI.

Good, then I think all the mysteries are solved.

> I would like to understand better the 'no longer shared' message in the
> error log.

That's a message that you get when you have closure problem.  It means
the variable will be cached the first time through and never change
again.

All that you need to do to fix this problem is to pass all of the
variables that your sub needs to the sub when you call it.  If you
don't understand what I mean, post one of your subs and we'll show you
how to change it.

- Perrin

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
I'm not even getting into any subroutines in the modules that the other 2
anchors invoke after the first anchor is executed.   Coming into the
modules, the 'str' values are wrong.   The modules that the anchors execute
are 3 different physical modules in contrast to logical subroutines in the
same physical module.  Maybe I'm just not really understanding what you all
are say to me.

CraigT

    

David Scott-2 wrote:
> 
> Have a look at this:
> 
> http://www.perl.com/pub/a/2002/05/07/mod_perl.html
> 
> Perrin is probably right that it's a closure issue.  Take a good look at 
> your code.
> 
> Incidentally, I've found it useful to do a Google search on 
> incomprehensible error messages ..:)
> 
> d
> 
> CraigT wrote:
>> Perrin,
>>
>> I'm not sure I'm communicating very well. And I'm not sure I understand
>> what
>> you said.  Let me outline what I'm experiencing again.  I have a page
>> with
>> multiple anchors.    I saw this problem immediately with 3 of these
>> anchors
>> when I invoked the page under perl-run (PerlRun).  The 3 anchors follow. 
>> I've left the   off on purpose so the anchor will show.
>>
>>  CLASS='zzz tn' HREF='dashboard.cgi?str=$govlevel:3'
>> ONMOUSEOVER=\"window.status='$glines[2] Key Indicators';return true\"
>> ONMOUSEOUT=\"window.status='  ';return true\">Dashboard</ 
>>
>> values passed = $govlevel:3 = SKY:3
>>
>>  CLASS='l2' HREF='ss.cgi?str=$govlevel'
>> ONMOUSEOVER=\"window.status='Sights
>> And Sounds Of $glines[0]';return true\" ONMOUSEOUT=\"window.status=' 
>> ';return true\">Sights/Sounds</
>>
>> values passed = $govlevel = SKY
>>
>>  CLASS='l2' HREF='vumenu.cgi?str=$govlevel~$vufiles'
>> ONMOUSEOVER=\"window.status='Special Interest, Measure Views';return
>> true\"
>> ONMOUSEOUT=\"window.status='  ';return true\">Special Views</
>>
>> values passed = $govlevel~$vufiles = SKY~C:/Steep/USA
>> Data/State/KY/birth.view!C:/Steep/USA
>> Data/State/KY/children.view!C:/Steep/USA
>> Data/State/KY/children2.view!C:/Steep/USA
>> Data/State/KY/children3.view!C:/Steep/USA
>> Data/State/KY/children4.view!C:/Steep/USA
>> Data/State/KY/healthybirths.view!C:/Steep/USA
>> Data/State/KY/healthybirths2.view!C:/Steep/USA
>> Data/State/KY/infantdeaths.view!C:/Steep/USA
>> Data/State/KY/infantdeathsin3counties.view!C:/Steep/USA
>> Data/State/KY/infantsmothers.view
>>
>> In each of the modules, I bring 'str' across with something like my
>> $somevar
>> = $page->param("str") assigning the paramter values to a declared Perl
>> variable.   And I do use strict everywhere.  I then work with those
>> paramters in the module invoked by the anchor.   But the issue isn't
>> about
>> working with what gets passed into the module invoked by the anchor.   I
>> don't get that far.   The problem is that what is coming across from the
>> invoking module to the invoked module is incorrect.
>>
>> Notice that the paramters being passed to each of the 3 different
>> physical
>> modules are passed after being assigned to the variable 'str'.  If I
>> execute
>> any of the 3 anchors first, setting and passing 'str', and then invoke
>> any
>> of the other 2 anchors, the value of 'str' set in the first invocation
>> persists such that the invocation of the other 2 anchors has the 'str'
>> values from the first invocation.   The value of 'str' will not change
>> after
>> that first anchor execution until I recycle the server.   The first
>> anchor I
>> executed keeps working and the other 2 keep getting passed the 'str'
>> values
>> from the first anchor execution and don't work.
>>
>> Also, I changed the name of 'str' to something unique in each of the 3
>> anchors and anchor modules.  When I do this, regardless of which one I
>> execute first, the first one works and then the other 2 pass nothing. 
>> And
>> again, it works fine under CGI.
>>
>> This code has worked correctly under CGI ever since it was written.  
>> I've
>> verified that under the perl-run execution the Perl variables assigned to
>> 'str' in all 3 anchors have the correct values before I execute the
>> anchors.  
>> And I've verified the values in 'str' that come across when I invoke the
>> anchors right after the $somevar = $page->param("str") line in each of
>> the
>> physical modules.  Regardless of which of these anchors I invoke first,
>> invoking either of the remaining 2 anchors results in the values of 'str'
>> set in the 1st anchor executed being passed to the modules that the
>> remaining 2 anchors execute.
>>
>> Also, the ENV variables I had in my scratchpad where mistakenly executed
>> under CGI.  When I printed the ENV stuff executed under perl-run
>> (PerlRun),
>> MOD_PERL is there.   You can see the perl-run ENV stuff by invoking the
>> following URL.  
>>
>> http://steepusa.no-ip.info/perl-run/stuff/prtenv.cgi
>>
>> I would like to understand better the 'no longer shared' message in the
>> error log.
>>
>> I hope this is clearer.  I am sort of at a loss here.  I live in a small
>> rural town in the foothills of the Appalachian Mountains and I have found
>> no
>> community here to bounce these kinds of things off of. 
>> I've dealt with a lot of bugs over the years in a variety of languages
>> and
>> this one seems strange.  Can you make any suggestions on how I might
>> proceed
>> here.   The Apache 'ab' modules tells me I can improve the # of request
>> per
>> second that my server can server by a facor of 3 and I would like to do
>> it
>> if I can.  
>>
>> CraigT
>>
>>
>>
>>
>>
>> Perrin Harkins wrote:
>>   
>>> [Please keep it on the list]
>>>
>>> On 7/3/07, Craig Tussey <ct...@yahoo.com> wrote:
>>>     
>>>> Thanks again for responding.  Here is the link to my
>>>> scratchpad.   Keep in mind that I was making entries
>>>> to the scratchpad in response to Clintons questions.
>>>>
>>>> http://www.perlmonks.org/?viewmode=public;node_id=624649
>>>>       
>>> Okay, you really aren't showing much code here.  From what you did
>>> show, I'm guessing you're doing this:
>>>
>>> my $govlevel = $page->param("str");
>>> print_html();
>>>
>>> sub print_html {
>>>     print "blah blah $govlevel blah blah";
>>> }
>>>
>>> That doesn't work because the sub becomes a closure and never notices
>>> when you create new versions of $govlevel.  The fix is to pass
>>> $govlevel to the sub as a parameter.
>>>
>>> - Perrin
>>>
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11433964
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by David Scott <ds...@earthlink.net>.
Have a look at this:

http://www.perl.com/pub/a/2002/05/07/mod_perl.html

Perrin is probably right that it's a closure issue.  Take a good look at 
your code.

Incidentally, I've found it useful to do a Google search on 
incomprehensible error messages ..:)

d

CraigT wrote:
> Perrin,
>
> I'm not sure I'm communicating very well. And I'm not sure I understand what
> you said.  Let me outline what I'm experiencing again.  I have a page with
> multiple anchors.    I saw this problem immediately with 3 of these anchors
> when I invoked the page under perl-run (PerlRun).  The 3 anchors follow. 
> I've left the   off on purpose so the anchor will show.
>
>  CLASS='zzz tn' HREF='dashboard.cgi?str=$govlevel:3'
> ONMOUSEOVER=\"window.status='$glines[2] Key Indicators';return true\"
> ONMOUSEOUT=\"window.status='  ';return true\">Dashboard</ 
>
> values passed = $govlevel:3 = SKY:3
>
>  CLASS='l2' HREF='ss.cgi?str=$govlevel' ONMOUSEOVER=\"window.status='Sights
> And Sounds Of $glines[0]';return true\" ONMOUSEOUT=\"window.status=' 
> ';return true\">Sights/Sounds</
>
> values passed = $govlevel = SKY
>
>  CLASS='l2' HREF='vumenu.cgi?str=$govlevel~$vufiles'
> ONMOUSEOVER=\"window.status='Special Interest, Measure Views';return true\"
> ONMOUSEOUT=\"window.status='  ';return true\">Special Views</
>
> values passed = $govlevel~$vufiles = SKY~C:/Steep/USA
> Data/State/KY/birth.view!C:/Steep/USA
> Data/State/KY/children.view!C:/Steep/USA
> Data/State/KY/children2.view!C:/Steep/USA
> Data/State/KY/children3.view!C:/Steep/USA
> Data/State/KY/children4.view!C:/Steep/USA
> Data/State/KY/healthybirths.view!C:/Steep/USA
> Data/State/KY/healthybirths2.view!C:/Steep/USA
> Data/State/KY/infantdeaths.view!C:/Steep/USA
> Data/State/KY/infantdeathsin3counties.view!C:/Steep/USA
> Data/State/KY/infantsmothers.view
>
> In each of the modules, I bring 'str' across with something like my $somevar
> = $page->param("str") assigning the paramter values to a declared Perl
> variable.   And I do use strict everywhere.  I then work with those
> paramters in the module invoked by the anchor.   But the issue isn't about
> working with what gets passed into the module invoked by the anchor.   I
> don't get that far.   The problem is that what is coming across from the
> invoking module to the invoked module is incorrect.
>
> Notice that the paramters being passed to each of the 3 different physical
> modules are passed after being assigned to the variable 'str'.  If I execute
> any of the 3 anchors first, setting and passing 'str', and then invoke any
> of the other 2 anchors, the value of 'str' set in the first invocation
> persists such that the invocation of the other 2 anchors has the 'str'
> values from the first invocation.   The value of 'str' will not change after
> that first anchor execution until I recycle the server.   The first anchor I
> executed keeps working and the other 2 keep getting passed the 'str' values
> from the first anchor execution and don't work.
>
> Also, I changed the name of 'str' to something unique in each of the 3
> anchors and anchor modules.  When I do this, regardless of which one I
> execute first, the first one works and then the other 2 pass nothing.  And
> again, it works fine under CGI.
>
> This code has worked correctly under CGI ever since it was written.   I've
> verified that under the perl-run execution the Perl variables assigned to
> 'str' in all 3 anchors have the correct values before I execute the anchors.  
> And I've verified the values in 'str' that come across when I invoke the
> anchors right after the $somevar = $page->param("str") line in each of the
> physical modules.  Regardless of which of these anchors I invoke first,
> invoking either of the remaining 2 anchors results in the values of 'str'
> set in the 1st anchor executed being passed to the modules that the
> remaining 2 anchors execute.
>
> Also, the ENV variables I had in my scratchpad where mistakenly executed
> under CGI.  When I printed the ENV stuff executed under perl-run (PerlRun),
> MOD_PERL is there.   You can see the perl-run ENV stuff by invoking the
> following URL.  
>
> http://steepusa.no-ip.info/perl-run/stuff/prtenv.cgi
>
> I would like to understand better the 'no longer shared' message in the
> error log.
>
> I hope this is clearer.  I am sort of at a loss here.  I live in a small
> rural town in the foothills of the Appalachian Mountains and I have found no
> community here to bounce these kinds of things off of. 
> I've dealt with a lot of bugs over the years in a variety of languages and
> this one seems strange.  Can you make any suggestions on how I might proceed
> here.   The Apache 'ab' modules tells me I can improve the # of request per
> second that my server can server by a facor of 3 and I would like to do it
> if I can.  
>
> CraigT
>
>
>
>
>
> Perrin Harkins wrote:
>   
>> [Please keep it on the list]
>>
>> On 7/3/07, Craig Tussey <ct...@yahoo.com> wrote:
>>     
>>> Thanks again for responding.  Here is the link to my
>>> scratchpad.   Keep in mind that I was making entries
>>> to the scratchpad in response to Clintons questions.
>>>
>>> http://www.perlmonks.org/?viewmode=public;node_id=624649
>>>       
>> Okay, you really aren't showing much code here.  From what you did
>> show, I'm guessing you're doing this:
>>
>> my $govlevel = $page->param("str");
>> print_html();
>>
>> sub print_html {
>>     print "blah blah $govlevel blah blah";
>> }
>>
>> That doesn't work because the sub becomes a closure and never notices
>> when you create new versions of $govlevel.  The fix is to pass
>> $govlevel to the sub as a parameter.
>>
>> - Perrin
>>
>>
>>     
>
>   


Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
Perrin,

I'm not sure I'm communicating very well. And I'm not sure I understand what
you said.  Let me outline what I'm experiencing again.  I have a page with
multiple anchors.    I saw this problem immediately with 3 of these anchors
when I invoked the page under perl-run (PerlRun).  The 3 anchors follow. 
I've left the   off on purpose so the anchor will show.

 CLASS='zzz tn' HREF='dashboard.cgi?str=$govlevel:3'
ONMOUSEOVER=\"window.status='$glines[2] Key Indicators';return true\"
ONMOUSEOUT=\"window.status='  ';return true\">Dashboard</ 

values passed = $govlevel:3 = SKY:3

 CLASS='l2' HREF='ss.cgi?str=$govlevel' ONMOUSEOVER=\"window.status='Sights
And Sounds Of $glines[0]';return true\" ONMOUSEOUT=\"window.status=' 
';return true\">Sights/Sounds</

values passed = $govlevel = SKY

 CLASS='l2' HREF='vumenu.cgi?str=$govlevel~$vufiles'
ONMOUSEOVER=\"window.status='Special Interest, Measure Views';return true\"
ONMOUSEOUT=\"window.status='  ';return true\">Special Views</

values passed = $govlevel~$vufiles = SKY~C:/Steep/USA
Data/State/KY/birth.view!C:/Steep/USA
Data/State/KY/children.view!C:/Steep/USA
Data/State/KY/children2.view!C:/Steep/USA
Data/State/KY/children3.view!C:/Steep/USA
Data/State/KY/children4.view!C:/Steep/USA
Data/State/KY/healthybirths.view!C:/Steep/USA
Data/State/KY/healthybirths2.view!C:/Steep/USA
Data/State/KY/infantdeaths.view!C:/Steep/USA
Data/State/KY/infantdeathsin3counties.view!C:/Steep/USA
Data/State/KY/infantsmothers.view

In each of the modules, I bring 'str' across with something like my $somevar
= $page->param("str") assigning the paramter values to a declared Perl
variable.   And I do use strict everywhere.  I then work with those
paramters in the module invoked by the anchor.   But the issue isn't about
working with what gets passed into the module invoked by the anchor.   I
don't get that far.   The problem is that what is coming across from the
invoking module to the invoked module is incorrect.

Notice that the paramters being passed to each of the 3 different physical
modules are passed after being assigned to the variable 'str'.  If I execute
any of the 3 anchors first, setting and passing 'str', and then invoke any
of the other 2 anchors, the value of 'str' set in the first invocation
persists such that the invocation of the other 2 anchors has the 'str'
values from the first invocation.   The value of 'str' will not change after
that first anchor execution until I recycle the server.   The first anchor I
executed keeps working and the other 2 keep getting passed the 'str' values
from the first anchor execution and don't work.

Also, I changed the name of 'str' to something unique in each of the 3
anchors and anchor modules.  When I do this, regardless of which one I
execute first, the first one works and then the other 2 pass nothing.  And
again, it works fine under CGI.

This code has worked correctly under CGI ever since it was written.   I've
verified that under the perl-run execution the Perl variables assigned to
'str' in all 3 anchors have the correct values before I execute the anchors.  
And I've verified the values in 'str' that come across when I invoke the
anchors right after the $somevar = $page->param("str") line in each of the
physical modules.  Regardless of which of these anchors I invoke first,
invoking either of the remaining 2 anchors results in the values of 'str'
set in the 1st anchor executed being passed to the modules that the
remaining 2 anchors execute.

Also, the ENV variables I had in my scratchpad where mistakenly executed
under CGI.  When I printed the ENV stuff executed under perl-run (PerlRun),
MOD_PERL is there.   You can see the perl-run ENV stuff by invoking the
following URL.  

http://steepusa.no-ip.info/perl-run/stuff/prtenv.cgi

I would like to understand better the 'no longer shared' message in the
error log.

I hope this is clearer.  I am sort of at a loss here.  I live in a small
rural town in the foothills of the Appalachian Mountains and I have found no
community here to bounce these kinds of things off of. 
I've dealt with a lot of bugs over the years in a variety of languages and
this one seems strange.  Can you make any suggestions on how I might proceed
here.   The Apache 'ab' modules tells me I can improve the # of request per
second that my server can server by a facor of 3 and I would like to do it
if I can.  

CraigT





Perrin Harkins wrote:
> 
> [Please keep it on the list]
> 
> On 7/3/07, Craig Tussey <ct...@yahoo.com> wrote:
>> Thanks again for responding.  Here is the link to my
>> scratchpad.   Keep in mind that I was making entries
>> to the scratchpad in response to Clintons questions.
>>
>> http://www.perlmonks.org/?viewmode=public;node_id=624649
> 
> Okay, you really aren't showing much code here.  From what you did
> show, I'm guessing you're doing this:
> 
> my $govlevel = $page->param("str");
> print_html();
> 
> sub print_html {
>     print "blah blah $govlevel blah blah";
> }
> 
> That doesn't work because the sub becomes a closure and never notices
> when you create new versions of $govlevel.  The fix is to pass
> $govlevel to the sub as a parameter.
> 
> - Perrin
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11432833
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
[Please keep it on the list]

On 7/3/07, Craig Tussey <ct...@yahoo.com> wrote:
> Thanks again for responding.  Here is the link to my
> scratchpad.   Keep in mind that I was making entries
> to the scratchpad in response to Clintons questions.
>
> http://www.perlmonks.org/?viewmode=public;node_id=624649

Okay, you really aren't showing much code here.  From what you did
show, I'm guessing you're doing this:

my $govlevel = $page->param("str");
print_html();

sub print_html {
    print "blah blah $govlevel blah blah";
}

That doesn't work because the sub becomes a closure and never notices
when you create new versions of $govlevel.  The fix is to pass
$govlevel to the sub as a parameter.

- Perrin

Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
On 7/3/07, CraigT <ct...@yahoo.com> wrote:
> I put a lot of stuff in my (cliff) scratchpad like the ENV values, the
> relevant Apache httpd entries, a dump, the Apache error log, and code
> examples.   Would it be possible for you to review the stuff I put there?

Maybe later.  Do you have a link for it?

> Clinton didn't spot anything.  But the MOD_PERL ENV variable is not getting
> set and this variable controls the release of globals in the beginning of
> CGI.pm.   I don't know how this variable gets established, but I think its
> an important clue.

If $ENV{'MOD_PERL'} is empty, you are running under CGI, not mod_perl.
 Maybe you have a typo in your code that checks it?

- Perrin

Re: passing CGI paramters

Posted by CraigT <ct...@yahoo.com>.
Perrin,

Thanks for responding.  I'm not sure why it posted four times.   I'm new
here.   I posted the original request Sunday morning I think.    I didn't
get any responses, so early this morning I registered as 'cliff'
with perl monks and made a similiar request.  

Clinton responded and worked with me for about an hour in the chatterbox.   
I put a lot of stuff in my (cliff) scratchpad like the ENV values, the
relevant Apache httpd entries, a dump, the Apache error log, and code
examples.   Would it be possible for you to review the stuff I put there?

Clinton didn't spot anything.  But the MOD_PERL ENV variable is not getting
set and this variable controls the release of globals in the beginning of
CGI.pm.   I don't know how this variable gets established, but I think its
an important clue.

My environment is Windows XP Home/Apache 2/Perl 5.8/mod_perl 2.   I can
execute my application under PerlRun (perl-run).  It executes.   But when I
click on anchors that pass CGI paramters using the same ?str variable to
pass the paramters, the parameter values passed in ?str when I execute the
first anchor (regardless of which one I execute first) persist.   These
values get passed to subsequent anchor executions passing the paramters
values in ?str.  The initial value of ?str persists until I recycle the
server.
The application does execute and operate correctly under CGI.

The 2 URLs for these execution environments are:
http://steepusa.no-ip.info/cgi-bin/m3.cgi
http://steepusa.no-ip.info/perl-run/m3.cgi 

I use strict everywhere and all Perl variables are declared with my.   I
have verified that the values of the varaiables I assign to ?str in the
anchors are correct in all anchor executions.

Thanks again Perrin.   I appreciate any help.

CraigT (or Cliff in Perl Monks)



Perrin Harkins wrote:
> 
> Hi,
> 
> There's no need to post your question four times.
> 
>> I'm trying to bring my application up using ModPerl::PerlRun.  I have
>> anchors at places in my code like  
>> HREF='vumenu.cgi?str=$govlevel~$vufiles'  where I'm passing parameters to
>> the HREF.   I use the ?str part of HREF in other anchor invocations.
>> However the first anchor execution ?str definition persists so that the
>> next
>> anchor executed using ?str has the ?str defintion of the first anchor
>> executed. I'm guessing that str is a global and persists.
> 
> I can't tell what you're doing from this description.  Can you show us
> some of your code?
> 
>> Additionally, if I execute the same anchor twice in a
>> row, changing the data the paramters are composed from between the 2
>> executions, the paramters do not change on the second execution under
>> PerlRun but do under CGI.
> 
> It sounds like your code has a scoping bug, probably an unintentional
> closure.  Can you show us the code where you get the CGI parameters?
> 
> - Perrin
> 
> 

-- 
View this message in context: http://www.nabble.com/passing-CGI-paramters-tf4008753.html#a11416640
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: passing CGI paramters

Posted by Perrin Harkins <pe...@elem.com>.
Hi,

There's no need to post your question four times.

> I'm trying to bring my application up using ModPerl::PerlRun.  I have
> anchors at places in my code like <A CLASS='l2'
> HREF='vumenu.cgi?str=$govlevel~$vufiles'  where I'm passing parameters to
> the HREF.   I use the ?str part of HREF in other anchor invocations.
> However the first anchor execution ?str definition persists so that the next
> anchor executed using ?str has the ?str defintion of the first anchor
> executed. I'm guessing that str is a global and persists.

I can't tell what you're doing from this description.  Can you show us
some of your code?

> Additionally, if I execute the same anchor twice in a
> row, changing the data the paramters are composed from between the 2
> executions, the paramters do not change on the second execution under
> PerlRun but do under CGI.

It sounds like your code has a scoping bug, probably an unintentional
closure.  Can you show us the code where you get the CGI parameters?

- Perrin