Accessing environment variables prior to invoking the contenthandler.

2003-07-31 Thread Mark Deepak Puttnam
Hi Group, I have a need to access all the %ENV (cgi,mod_perl sent by the client) variables prior to invoking the content handler. I am using the modperl environment by running the cgi scripts under Perl::Registry. I wish to use the PerlTransHandler to check if the request for page A has orginated

Re: Accessing environment variables prior to invoking the contenthandler.

2003-07-31 Thread Perrin Harkins
On Thu, 2003-07-31 at 15:44, Mark Deepak Puttnam wrote: I have used the following code in the in my handler and I still do not get the values. Do you get anything at all? HTTP_REFERER is not always sent by browsers. - Perrin

Accessing environment variables prior to invoking thecontenthandler.

2003-07-31 Thread Mark Deepak Puttnam
Only PERL_SEND_HEADER=On. No other env. variables. I did run tests by clicking on links to check to see if the HTTP_REFERER is being set. Mark.

Re: Accessing environment variables prior to invoking thecontenthandler.

2003-07-31 Thread Perrin Harkins
On Thu, 2003-07-31 at 16:15, Mark Deepak Puttnam wrote: Only PERL_SEND_HEADER=On. No other env. variables. And you haven't turned off PerlSetupEnv in your httpd.conf? - Perrin

Re: Accessing environment variables prior to invoking the contenthandler.

2003-07-31 Thread Perrin Harkins
On Thu, 2003-07-31 at 15:44, Mark Deepak Puttnam wrote: sub handler { my $r=shift; my $env=$r-subprocess_env; %ENV=%$senv; my $referer=$ENV{'HTTP_REFERER'}; x } Come to think of it, you should just use the Apache API for this: my

Accessing environment variables prior to invoking the contenthandler.

2003-07-31 Thread Mark Puttnam
I did not have that directive in my config before. But now,I set it explicitly to PerlSetupEnv On , still no env variables other than the PERL_SEND_HEADER=On. Mark

Accessing environment variables prior to invoking thecontenthandler.

2003-07-31 Thread Mark Puttnam
Hi Perrin, my $referer = $r-header_in(Referer); Thanks, the above statement did give me the value. Mark

Database Connections Global Variables

2003-07-25 Thread Levon Barker
Hello, I have a question. If I have a $dbh global variable in a particular module that I 'use'. I know that Apache::DBI will give a cached connection to the module to use. But what if I do something like $dbh-commit(); Is it possible that I am committing data for another session by accident?

Re: Database Connections Global Variables

2003-07-25 Thread Perrin Harkins
On Fri, 2003-07-25 at 14:55, Levon Barker wrote: If I have a $dbh global variable in a particular module that I 'use'. I know that Apache::DBI will give a cached connection to the module to use. There is no need to use a global. Apache::DBI caches it for you. If you put it in a global, then

Variables

2003-07-21 Thread Dennis Stout
In this project I'm making (database), I have several variables with a potential for a large amount of information to be held in them. They're all hashes. Some are hashes of hashes... There is a tech_list, which holds information about each technician. There is a queue_list which holds an ID

Re: Variables

2003-07-21 Thread Perrin Harkins
Dennis Stout wrote: Is there a way I could get these variables populated on server start and never loaded again unless the database was changed? So in my subroutine for posting an event that changed it I could call repopulate_queue_hash and have it redo the hash, so changes still happened without

Re: Variables

2003-07-21 Thread Dennis Stout
Is there a way I could get these variables populated on server start and never loaded again unless the database was changed? So in my subroutine for posting an event that changed it I could call repopulate_queue_hash and have it redo the hash, so changes still happened without a restart

Re: Variables

2003-07-21 Thread Perrin Harkins
Dennis Stout wrote: So in startup.perl put my %queue_list = list_queues; my %tech_list = list_techs; and so on? Then each process would get a copy of the hash? No, those are lexicals, not globals. Something like this: package MyCompany::Globals; use vars qw(%queue_list %tech_list); %queue_list

getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
I'm not able to get *any* variables out from the apache server environment. As you might be able to imagine, this is extremely frustrating, and inhibits my ability to do anything of use with mod_perl. My basic technique has been: my $uri = $r-uri; return unless $r-is_main

Re: getting *any* variables out of the server environment

2003-06-09 Thread Perrin Harkins
On Mon, 2003-06-09 at 14:29, Ryan Muldoon wrote: I'm not able to get *any* variables out from the apache server environment. Did you try the normal $ENV{'VARIABLE'} approach? - Perrin

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
I tried that as well (and just re-tried). My understanding is that the %ENV hash only gets updated in the fixup stage, so the mod_ssl environment variables can't be accessed that way. Thanks for the suggestion though! --Ryan On Mon, 2003-06-09 at 13:41, Perrin Harkins wrote: On Mon

RE: getting *any* variables out of the server environment

2003-06-09 Thread Marc M. Adkins
IF you're using mp2...in your httpd.conf are you setting up the handlers with modperl or perl-script? The former doesn't provide any environment variables: http://perl.apache.org/docs/2.0/user/config/config.html#C_SetHandler_ I don't believe this applies to mp1. mma -Original

RE: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
I'm using mod_perl 1. But I'm setting the handlers in httpd.conf. I sent a message to the list on thursday (problem with pulling variables from mod_ssl) that more fully describes my situtation. --Ryan On Mon, 2003-06-09 at 14:31, Marc M. Adkins wrote: IF you're using mp2...in your

Re: getting *any* variables out of the server environment

2003-06-09 Thread Perrin Harkins
On Mon, 2003-06-09 at 14:49, Ryan Muldoon wrote: I tried that as well (and just re-tried). My understanding is that the %ENV hash only gets updated in the fixup stage, so the mod_ssl environment variables can't be accessed that way. Thanks for the suggestion though! Okay. And you're certain

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
any kind of difference. To make sure it isn't just mod_ssl being lame for some reason, I've tried it with DOCUMENT_ROOT and other standard ENV variables. But to no avail. :( --Ryan On Mon, 2003-06-09 at 13:59, Geoffrey Young wrote: Ryan Muldoon wrote: I'm not able to get *any

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
environment variables can't be accessed that way. Thanks for the suggestion though! Okay. And you're certain that a simple $r-subprocess_env('VARIABLE') doesn't work? Have you tried setting a variable yourself as a test with PerlSetEnv in httpd.conf? - Perrin

Re: getting *any* variables out of the server environment

2003-06-09 Thread Issac Goldstand
Ryan, Ust out of curiosity, at what stage in the request chain are you doing this? If you are doing anything before mod_ssl populates its environment variables (which I seem to rembmer being at Fixup, although I may be confusing with something else), you wouldn't be able to access them. You

Re: getting *any* variables out of the server environment

2003-06-09 Thread Randy Kobes
SSL_CLIENT_S_DN_CN in my httpd.conf, but it doesn't seem to make any kind of difference. To make sure it isn't just mod_ssl being lame for some reason, I've tried it with DOCUMENT_ROOT and other standard ENV variables. But to no avail. :( Do you have a SSLOptions +StdEnvVars directive inside

Re: getting *any* variables out of the server environment

2003-06-09 Thread Geoffrey Young
mod_ssl does not (but mod_cgi and mod_perl both do). the problem you're seeing is that these variables are setup during the fixup phase, so in using a PerlAuthenHandler you're trying to see them too early. int ssl_hook_Fixup(request_rec *r) { SSLSrvConfigRec *sc = mySrvConfig(r-server

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
reason, I've tried it with DOCUMENT_ROOT and other standard ENV variables. But to no avail. :( Do you have a SSLOptions +StdEnvVars directive inside the relevant location of your httpd.conf?

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
Goldstand wrote: Ryan, Ust out of curiosity, at what stage in the request chain are you doing this? If you are doing anything before mod_ssl populates its environment variables (which I seem to rembmer being at Fixup, although I may be confusing with something else), you wouldn't be able

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
to make any kind of difference. Ryan To make sure it isn't just mod_ssl being lame for some reason, I've Ryan tried it with DOCUMENT_ROOT and other standard ENV variables. But to no Ryan avail. :( That takes the enviroment variables that apache was started with and passes those to mod_perl

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
see, that's not entirely true. they are set in subprocess_env where they sit and wait, presumably for somebody else to call add_cgi_vars since mod_ssl does not (but mod_cgi and mod_perl both do). the problem you're seeing is that these variables are setup during the fixup phase, so

Re: getting *any* variables out of the server environment

2003-06-09 Thread Perrin Harkins
On Mon, 2003-06-09 at 15:35, Geoffrey Young wrote: no, I wasn't saying that :) subprocess_env() from the main request is the right way to go. I was just trying to let you know that it has nothing to do with %ENV really. I wouldn't go that far. %ENV does get populated with that stuff, just

Re: getting *any* variables out of the server environment

2003-06-09 Thread Geoffrey Young
Ok, removed. Thank you very much for the in-depth replies. It is very useful. Unfortunately any variable-reading continues to elude me. But I really appreciate all the help! well, it sounds like you are having a larger problem that just mod_ssl-based variables. since you mention you're

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
Actually, upon flushing my browser cache and checking again, I can in fact read the MOD_PERL environment variable just fine. But still no luck on any mod_ssl related variables. --Ryan

Re: getting *any* variables out of the server environment

2003-06-09 Thread Perrin Harkins
[ Please keep it on the list. ] On Mon, 2003-06-09 at 16:12, Ryan Muldoon wrote: Ryan, can you post a more complete code example? - Perrin Here it is: package Apache::AuthNx509; use strict; use Apache::Constants qw(:common); use Text::ParseWords qw(quotewords); use Apache::Log

Re: getting *any* variables out of the server environment

2003-06-09 Thread Ryan Muldoon
On Mon, 2003-06-09 at 15:24, Perrin Harkins wrote: [ Please keep it on the list. ] Sorry about that! On Mon, 2003-06-09 at 16:12, Ryan Muldoon wrote: Ryan, can you post a more complete code example? - Perrin Here it is: package Apache::AuthNx509; use strict; use

problem with pulling variables from mod_ssl

2003-06-06 Thread Ryan Muldoon
I'm trying to write an apache authentication module that uses client certificates for authentication. Basically, all I'm trying to do is use what mod_ssl does for cert verification, and then set REMOTE_USER. I wrote to the list last week about a segfault, which was resolved thanks to the help you

virtualhost based variables

2002-10-02 Thread Alan
Greetings again. I'm trying to figure out the best/fastest/most elegant way of setting virtualhost based variables. Basically I have three sites, and the only difference between them is the DocumentRoot ($htdocroot) and the database their data is being accessed from ($dbh). When

Re: virtualhost based variables

2002-10-02 Thread James G Smith
Alan [EMAIL PROTECTED] wrote: Greetings again. I'm trying to figure out the best/fastest/most elegant way of setting virtualhost based variables. Basically I have three sites, and the only difference between them is the DocumentRoot ($htdocroot) and the database their data is being accessed

Re: virtualhost based variables

2002-10-02 Thread Alan
On Wed, Oct 02, 2002 at 06:04:03PM -0500, James G Smith wrote: Alan [EMAIL PROTECTED] wrote: Greetings again. I'm trying to figure out the best/fastest/most elegant way of setting virtualhost based variables. Basically I have three sites, and the only difference between them

Perl environment variables in mod_perl 1.26

2002-10-01 Thread Danial Pearce
to the original request. If this original request was for a mod_perl module, then it doesn't recieve it's appropriate INC. The environment variables are all set properly, ie: PERL5LIB is what is supposed to be, it's just that the INC hasn't be rebuilt. Does anyone know if this is a bug in mod_perl? I

RE: variables not changing with modperl??

2002-08-13 Thread david . morgan
I'm sure someone will correct me if I'm wrong... But, variables in the initial section (ie outside of a function) in the main package will stay in scope all the time. This means that it will retain the value from a previous request- which might be giving you these problems. As Perrin Harkins

Re: variables not changing with modperl??

2002-08-13 Thread darren chamberlain
$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

Re: variables not changing with modperl??

2002-08-13 Thread Paul Simon
ey; ($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

Re: variables not changing with modperl??

2002-08-13 Thread Perrin Harkins
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

Re: variables not changing with modperl??

2002-08-13 Thread Michael Drons
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

Re: variables not changing with modperl??

2002-08-13 Thread Ken Y. Clark
On Tue, 13 Aug 2002, Michael Drons wrote: Date: Tue, 13 Aug 2002 07:46:16 -0700 (PDT) From: Michael Drons [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Perrin Harkins [EMAIL PROTECTED], darren chamberlain [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: variables not changing

Re: variables not changing with modperl??

2002-08-13 Thread Perrin Harkins
Ken Y. Clark wrote: As for this and Perrin's comment about parsing on your own, the point is that you've written a lot of code that has already been written and debugged by a lot of really smart people. There's no reason for you to be reading STDIN and spliting and all that. If you're using

variables not changing with modperl??

2002-08-12 Thread Michael Drons
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

Re: variables not changing with modperl??

2002-08-12 Thread Michael Drons
(/:/,$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

Exporter variables get lost

2002-06-07 Thread Viljo Marrandi
, it this some mod_perl specific feature to just eat up some variables, or what? Here are cut-down versions of my modules: Site.pm: - package Site; use strict; use Apache::Log; sub handler { my $r = shift; use vars qw( $log

Re: Exporter variables get lost

2002-06-07 Thread Rafael Garcia-Suarez
Viljo Marrandi actually wrote: my $r = shift; use vars qw( $log ); $log = $r-log(); if ( $some_case eq 'true' ) { use Sub::First qw( $log ); I haven't tested, but this doesn't look as a good idea. I don't think your code does what you think it does (or what you think it

Re: Exporter variables get lost

2002-06-07 Thread Tim Tompkins
The answer to the trick question is that the subroutine name in package Sub::First is misspelled (missing a t). However, I think I would provide the Apache::Log object as a parameter to new() rather than twiddling with package vars to try to have it magically updated by Exporter. For example:

Re: Scope of Perl Special Variables

2002-05-05 Thread Bill Catlan
Stas Bekman wrote: This explains why by default %ENV is set for each request afresh. http://perl.apache.org/guide/performance.html#PerlSetupEnv_Off Great. Thank you Stas. Now I know /how/ that happens, but I don't know /why/ the existing inctances' ENV is not clobbered. My guess is that a

Re: Scope of Perl Special Variables

2002-05-05 Thread Bill Catlan
I thought that using 'local' would successfully scope those globals to within a sub, so you could,k for example, slurp an entire file by doing: local $/ = undef; my $file = FH; Or am I wrong in that? I use it frequently, and don't seem to have any troubles. --Jon R. It is my

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-05-05 Thread Jason Woodward
You'll also need to use a PerlPassEnv directive prior to your Perl block. For debug purposes, try adding the following inside your Perl block: print join(\n, map { $_ = $ENV{$_} } (keys %ENV)), \n; OR, my personal quick-debugging catch-all: use Data::Dumper; print Dumper \%ENV; You'll be

Re: Scope of Perl Special Variables

2002-05-05 Thread Jon
DA FC 06 AB 4C D6 A4 DE 03 E0 77 D6 DE E0 73 PGP public key available by fingering [EMAIL PROTECTED] On Fri, 3 May 2002, Bill Catlan wrote: Hello, The online mod_perl guide (http://thingy.kcilink.com/modperlguide/perl/The_Scope_of_the_Special_Perl_Va.ht ml) states: Special Perl variables

Re: Scope of Perl Special Variables

2002-05-05 Thread Mark Fowler
troubles. Okay, local takes a temporary copy of the variable and then restores the original value at the end of the block. It's the same variable though. my creates a new variable that is only visible from within the block and can't be seen from other subroutines. With my there are two variables

Re: Scope of Perl Special Variables

2002-05-05 Thread Stas Bekman
Bill Catlan wrote: Stas Bekman wrote: This explains why by default %ENV is set for each request afresh. http://perl.apache.org/guide/performance.html#PerlSetupEnv_Off Great. Thank you Stas. Now I know /how/ that happens, but I don't know /why/ the existing inctances' ENV is not

Re: Scope of Perl Special Variables

2002-05-04 Thread Stas Bekman
Bill Catlan wrote: Hello, The online mod_perl guide (http://thingy.kcilink.com/modperlguide/perl/The_Scope_of_the_Special_Perl_Va.ht ml) states: Special Perl variables like $| (buffering), $^T (script's start time), $^W (warnings mode), $/ (input record separator), $\ (output record

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-05-03 Thread Fran Fabrizio
What I was really looking for was $r-server_root_relative. =) Thanks Geoff! That's to all for your help. -Fran You'll also need to use a PerlPassEnv directive prior to your Perl block. For debug purposes, try adding the following inside your Perl block: print join(\n, map { $_ =

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-05-02 Thread Ken Williams
On Wednesday, May 1, 2002, at 05:04 AM, Fran Fabrizio wrote: I spoke too soon. I need: Perl push Alias, [ qw(/cgi-bin/chimpkit/ $ENV{SERVER_ROOT}/cgi- bin/chimpkit/) ]; /Perl This does not appear to be possible because there's no way to pass in SERVER_ROOT to the apache startup.

Can mod_perl help me use ENV variables in httpd.conf?

2002-04-30 Thread Fran Fabrizio
I am trying to make a portable mod_perl.conf. I have things like: Alias /cgi-bin/chimpkit/ /usr/local/apache/cgi-bin/chimpkit/ Location /cgi-bin/chimpkit/ SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On /Location which really needs

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-04-30 Thread Steven Lembark
Yup. See the perl directive. Good description of how it works in the Eagle Book. -- Fran Fabrizio [EMAIL PROTECTED] I am trying to make a portable mod_perl.conf. I have things like: Alias /cgi-bin/chimpkit/ /usr/local/apache/cgi-bin/chimpkit/ Location /cgi-bin/chimpkit/ SetHandler

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-04-30 Thread Fran Fabrizio
Yikes, I just found an example of the exact thing I needed in the cookbook (recipe 2.16). Sorry, and thanks! -Fran

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-04-30 Thread Fran Fabrizio
I spoke too soon. I need: Perl push Alias, [ qw(/cgi-bin/chimpkit/ $ENV{SERVER_ROOT}/cgi-bin/chimpkit/) ]; /Perl This does not appear to be possible because there's no way to pass in SERVER_ROOT to the apache startup. I have SERVER_ROOT getting set in root's .bashrc, but when I execute

Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-04-30 Thread Geoffrey Young
Fran Fabrizio wrote: I spoke too soon. I need: Perl push Alias, [ qw(/cgi-bin/chimpkit/ $ENV{SERVER_ROOT}/cgi-bin/chimpkit/) ]; /Perl This does not appear to be possible because there's no way to pass in SERVER_ROOT to the apache startup. I have SERVER_ROOT getting set in

Global (to page) variables under Apache::ASP

2002-04-23 Thread Simon Oliver
In my httpd.conf I have set 'PerlSetVar UseStrict 1' because I always use sctict anyway and I see in the docs that this might become the default too. So I always declare my variables with my(). Suppose I have a master ASP file that includes other scripts and these other scripts need access

Re: Global (to page) variables under Apache::ASP

2002-04-23 Thread Joshua Chamas
'PerlSetVar UseStrict 1' because I always use sctict anyway and I see in the docs that this might become the default too. So I always declare my variables with my(). Suppose I have a master ASP file that includes other scripts and these other scripts need access to the variables declrared

Re: Are global variables truly global?

2001-11-05 Thread Dominique Quatravaux
. So I have defined the variable as a package level variable. Package level variables are shared upon fork(), in the sense that the memory segment(s) they use is made available to all child processes. BUT the memory itself isn't shared, and any subsequent write to the variable in one of the children

RE: Are global variables truly global?

2001-11-05 Thread Matt Sergeant
-Original Message- From: Chui G. Tey [mailto:[EMAIL PROTECTED]] package Apache::MyPkg; my $COM_instance; sub handler { if (!$COM_instance) { $COM_instance = Win32::OLE-new(ProgID.Class); } } Will the different child processes created by Apache share the

Are global variables truly global?

2001-11-04 Thread Chui G. Tey
I have some state data that I need to persist between requests. At the moment these are COM objects, but they'll be ported to Perl Classes. It is quite important that only one of these instances exist per web server. These instances are too large to write and read to file on every request. So I

Re: Are global variables truly global?

2001-11-04 Thread Steven Lembark
and read to file on every request. So I have defined the variable as a package level variable. I have been instantiating the variable in my handler() routine if it has not already been instantiated. ie. Global variables are exactly that: global. If you use something like: our $foo

Re: Are global variables truly global?

2001-11-04 Thread Perrin Harkins
Will the different child processes created by Apache share the same variable? Or will each child create an additional instance? Each child has a separate interpreter and thus a separate instance of your global. If you need to co-ordinate data between processes, you might want to look at

Environment variables and mod_perl

2001-08-28 Thread Tom Mornini
I'm working on a project that is highly configurable via environment variables. I'd like a way to get those environment variables into my mod_perl processes so that the mod_perl portion of this project can be configured the same way as the non mod_perl portions. I know that I can use

Re: Converting Perl section variables into plain text directives

2001-08-25 Thread Cees Hek
On Fri, 24 Aug 2001, Eric Hammond wrote: Is there any way to take the Apache::ReadConfig name space (variables set in Perl sections) and generate plain text Apache directives? I don't know if there is a simple answer to this one, but the way I would handle it is to scrap the Perl sections

Re: Global variables

2001-05-16 Thread will trillich
, this is a question which may be not right here ! I don`t want to use the perlmodule CGI !! I hope some persons can help me, primarily, global variables are looked down upon. but like the error message says, you can explicitly name any global like this: $The::Meaning::Of::Life::The::Universe

Global variables

2001-05-15 Thread Bjoern
Hi all, i want to define a global variable which is also present in subroutines coded in extra perl modules. I tried this our $test; but amod_perl tells me following Global symbol $test requires explicit package name I know, this is a question which may be not right here ! I don`t want to use

Re: Environment variables in startup.pl

2001-04-30 Thread darren chamberlain
Scott Alexander ([EMAIL PROTECTED]) said something to this effect on 04/27/2001: Should this work in a startup.pl file my $hostname = $ENV{HOSTNAME} ; from the prompt I can write echo $HOSTNAME and get the correct hostname of the server. But from within startup.pl I don't get it.

[OT] How to write this perl sub w/o variables?

2001-04-29 Thread Philip Mak
Is it possible to rewrite this perl subroutine without using variables? sub XMLEncode { my ($line) = @_; $line =~ s//amp;/g; $line =~ s//lt;/g; $line =~ s//gt;/g; return $line; } I was thinking something like sub XMLEncode { s//amp;/g; s//lt;/g; s//gt;/g

Re: [OT] How to write this perl sub w/o variables?

2001-04-29 Thread Honza Pazdziora
On Sun, Apr 29, 2001 at 04:34:40AM -0400, Philip Mak wrote: I was thinking something like sub XMLEncode { local $_ = shift; s//amp;/g; s//lt;/g; s//gt;/g; return $_; } -- Honza

Re: [OT] How to write this perl sub w/o variables?

2001-04-29 Thread Stas Bekman
On Sun, 29 Apr 2001, Philip Mak wrote: Is it possible to rewrite this perl subroutine without using variables? sub XMLEncode { my ($line) = @_; $line =~ s//amp;/g; $line =~ s//lt;/g; $line =~ s//gt;/g; return $line; } I was thinking something like sub XMLEncode

Re: Environment variables in startup.pl

2001-04-28 Thread G.W. Haywood
Hi there, On Fri, 27 Apr 2001, Philip Mak wrote: On Fri, 27 Apr 2001, Scott Alexander wrote: Should this work in a startup.pl file my $hostname = $ENV{HOSTNAME} ; from the prompt I can write echo $HOSTNAME and get the correct hostname of the server. But from within startup.pl I

Environment variables in startup.pl

2001-04-27 Thread Scott Alexander
Should this work in a startup.pl file my $hostname = $ENV{HOSTNAME} ; from the prompt I can write echo $HOSTNAME and get the correct hostname of the server. But from within startup.pl I don't get it. Scott

Re: Environment variables in startup.pl

2001-04-27 Thread Philip Mak
On Fri, 27 Apr 2001, Scott Alexander wrote: Should this work in a startup.pl file my $hostname = $ENV{HOSTNAME} ; from the prompt I can write echo $HOSTNAME and get the correct hostname of the server. But from within startup.pl I don't get it. The reason echo $HOSTNAME works from the

Global Variables Question

2001-04-25 Thread Warren D. Johnson
Hello All, I apologize if this is in a FAQ somewhere. I have a script, lets call it test.pl. Test.pl requires in config.pl. Test.pl uses variables (via use vars) from config.pl. These variables are defined and given values in config.pl. AFter the first usage of test.pl, the variables we

Re: Global Variables Question

2001-04-25 Thread Mike Cameron
http://perl.apache.org/guide/porting.html#Configuration_Files_Writing_Dy Guide Good! Warren D. Johnson wrote: Hello All, I apologize if this is in a FAQ somewhere. I have a script, lets call it test.pl. Test.pl requires in config.pl. Test.pl uses variables (via use vars) from config.pl

Re: mod_perl forgets filled global variables

2001-04-01 Thread G.W. Haywood
your processes, and this is a topic often discussed on this List. You might like to search the archives for things like DBM, tied hash, database, shared data, shared variables. There are links to search engines on the mod_perl home page. Also there are one or two things in the DIGEST which might

mod_perl forgets filled global variables

2001-03-30 Thread werner.schmidt-wilczek
correct but perhaps it has forgotten all the global filled variables - what happens. I called the Dumper \@ARTIKEL and he says the array is filled, but next time the array is empty - what is my failure??? Please help me I am looking forward to your answer with greetings Werner Schmidt

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-20 Thread Jauder Ho
of bugs (witch were fixed in 5.7.0) Best Cb - Original Message - From: "Jauder Ho" [EMAIL PROTECTED] To: "Bogomolnyi Constantin" [EMAIL PROTECTED] Sent: Monday, March 19, 2001 8:44 AM Subject: Re: perl5.6 (was: Shared variables, inner subs and "our")

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-19 Thread Bogomolnyi Constantin
support. 5.6.0 has a lot of bugs (witch were fixed in 5.7.0) Best Cb - Original Message - From: "Jauder Ho" [EMAIL PROTECTED] To: "Bogomolnyi Constantin" [EMAIL PROTECTED] Sent: Monday, March 19, 2001 8:44 AM Subject: Re: perl5.6 (was: Shared variables, inner subs

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-17 Thread Bogomolnyi Constantin
modperl" [EMAIL PROTECTED] Sent: Saturday, March 17, 2001 6:20 AM Subject: Re: perl5.6 (was: Shared variables, inner subs and "our") Stas Bekman wrote: our() and other perl5.6 new APIs are too early to be endorsed, as 5.6 is not yet considered as a stable version for mod_perl

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-17 Thread Dave Rolsky
On Fri, 16 Mar 2001, Bogomolnyi Constantin wrote: You should probably try 5.7.0 witch is much more stable than 5.6.0 (you should not try unicode stuff , whitch is quite buggy) I use 5.7.0 on all my production servers without any problems . 5.7.0 may have fixed some of the bugs of 5.6.0 but

Shared variables, inner subs and our

2001-03-16 Thread Steve Hay
Hi, I was just tidying up an old mod_perl script which had some ugly "use vars qw(...);" lines in it which I thought I'd replace with "our ...;". I realise this isn't always a good idea since "our" is not intended as a replacement for "use vars", but its often OK and I thought it would be in my

Re: Shared variables, inner subs and our

2001-03-16 Thread Paul
not really answering your questions, but Ragarding moving the "our()" statement out of the function -- --- Steve Hay [EMAIL PROTECTED] wrote: (b) because I can't actually do what I just did above in my mod_perl script! Couldn't you, if you put the func's into a module and our()'d it

Re: Shared variables, inner subs and our

2001-03-16 Thread Stas Bekman
On Fri, 16 Mar 2001, Paul wrote: not really answering your questions, but Ragarding moving the "our()" statement out of the function -- --- Steve Hay [EMAIL PROTECTED] wrote: (b) because I can't actually do what I just did above in my mod_perl script! Couldn't you, if you put the

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-16 Thread Wim Kerkhoff
Stas Bekman wrote: our() and other perl5.6 new APIs are too early to be endorsed, as 5.6 is not yet considered as a stable version for mod_perl production sites, therefore the guide barely touches on it. Would you recommend the use of perl5.6 with mod_perl? What you are saying is making me

Re: perl5.6 (was: Shared variables, inner subs and our)

2001-03-16 Thread Stas Bekman
On Fri, 16 Mar 2001, Wim Kerkhoff wrote: Stas Bekman wrote: our() and other perl5.6 new APIs are too early to be endorsed, as 5.6 is not yet considered as a stable version for mod_perl production sites, therefore the guide barely touches on it. Would you recommend the use of perl5.6

Re: PerlRun problem: undefined variables (Was: can't find method uri)

2001-02-09 Thread Jie Gao
gets the location of a file from a PerlSetVar directive, and then opens the file and reads username and password into the variables to be used for database connection: --- my ($dsf, $db_f_name, $db_user_name, $db_user_pwd

RE: Help: Can't use string (Exchange::Account::My) as a HASH ref while strict refs in use trying to use instance variables in my handler

2001-02-07 Thread Chris Strom
Anyway, what you should do is create a constructor: sub new { [snip] You mean like this code segment that I included in my original post just below the handler code :) sub init { [snip] Ah yes, but you called your's "init", which is quite misleading to those of us who tend not to

RE: Help: Can't use string (Exchange::Account::My) as a HASH ref while strict refs in use trying to use instance variables in my handler

2001-02-06 Thread Chris Strom
Subject: Help: Can't use string ("Exchange::Account::My") as a HASH ref while "strict refs" in use trying to use instance variables in my handler [snip] sub handler ($$) { my ($self, $q) = @_; my $r= Apache::Request-new($q); $self-child_init unless $sel

Re: Help: Can't use string (Exchange::Account::My) as a HASH ref while strict refs in use trying to use instance variables in my handler

2001-02-06 Thread Christopher L. Everett
less $self-{_child_started_up}; # The rest of the code... Then you should be good to go (instance variables and all!). Hope that helps, Chris Except for calling the contructor with every call of the handler, I think I've done everything right. Isn't the part of idea behind mod_per

Re: Text::Template and passing in variables; going bug nuts!

2001-01-26 Thread T.J. Mather
Maybe I'm missing something here, but can't you just use use strict; use vars qw(%config %session); or better yet, fully qualify your variables %MyApp::Framework::config; %MyApp::Framework::session; The mod_perl guide has excellent sections on this: http://perl.apache.org/guide/perl.html

  1   2   3   >