Re: variables not changing with modperl??
Sorry, There is a my in front of the ($cookie,$user) code. I am confused about your second statement about parsing the input. What should I be doing? Do you mean I should use $r-read($content, $r-header_in('Content-length'))? to read in the variables? I use the AuthCookie modules to set the cookies and to authenicate. Mike --- Perrin Harkins [EMAIL PROTECTED] wrote: darren chamberlain wrote: Make those global symbols ($cookie, $user, and $hash) lexical (declare with my) and the code will both compile and do what you expect (i.e., not maintain values from call to call). That's what I was thinking too. Also, it's really not a good idea to do your own parsing of the input and cookies. You should use one of the CGI modules or Apache::Request and Apache::Cookie for this. Writing your own routine for this is just asking for security problems and bugs. - Perrin __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
variables not changing with modperl??
I am using Apache::Registry (Apache 1.3.26) I am see weird things happen with my scripts. I have have use strict in all of the scripts and I use my() for all of my variables. But I still have variables that contain data from previous loads. I see it in hashes and arrays. Especially, if I have an array that contains 6 strings in load 1 and only 2 strings in load 2. In the second load of the script the array will contain the 2 new strings and the 4 old strings. Everything I can find in docs says read the FAQ at http://perl.apache.org/faq/, which does not exists. This link comes from the subscribe message. I have thought about using PerlRun, but a module I use (AuthCookie) requies mod_perl. How do I undefine or reinit the variable? I am currently using undef, but it does not work. Mike Drons __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
Re: variables not changing with modperl??
Thanks for the link. I actually don't use functions. Everything is mostly in MAIN. Here is a snip of code: #!/usr/bin/perl -wT use strict; print body; my $r = Apache-request; $r-content_type(text/html); $r-status(200); my $auth_type = $r-auth_type; $cookie=$auth_type-key; ($user,$hash)=split(/:/,$cookie); read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'}); my @pairs = split(//, $buffer); foreach my $pair (@pairs) { } What I am doing wrong? Everytime the script runs the values of the variables coming in change. Should I use the delete function and delete all of the variables at the end of the script? @pairs is what should change, but sometimes does not. I have tried to add a undef @pairs before the split, but no luck. Mike --- Perrin Harkins [EMAIL PROTECTED] wrote: Michael Drons wrote: I am using Apache::Registry (Apache 1.3.26) I am see weird things happen with my scripts. I have have use strict in all of the scripts and I use my() for all of my variables. But I still have variables that contain data from previous loads. Sounds like the closure problem with subroutines in Apache::Registry. Does you code have subroutines that refer to variables declared outside of them? Everything I can find in docs says read the FAQ at http://perl.apache.org/faq/, which does not exists. Read this: http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___Scoped_Variable_in_Nested_Subroutines - Perrin __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com