You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Helios de Creisquer <cr...@zehc.net> on 2001/02/20 11:21:33 UTC

mod_perl_traps && my($var) = '';

Hi !

I just installed mod_perl 1.25 / apache 1.3.17 to speed up a CGI already
existing.
All works well, finally...

but I had a problem with my variables initialization:
I used at beginning of script:
	...
	my($var) = '';
	...
I know this is a little dirty... everyway,
It seems that when mod_perl encouter a 'my' statement,
it doesn't evaluate it again next time the script is executed.
To solve this I had to use:
	...
	my($var);
	...
	$var='';
	...
It gave me headaches, cause this is not specified in mod_perl_traps.
Perhaps It would be good to add this in the mod_perl_traps man page.
That'all...

errr... just a question therefore:
	Is there an explication to this mod_perl comportement ?
	(Just curious ;o)

Cheers,

-- 
Helios     de     Creisquer
mail:     helios@balios.org

Re: mod_perl_traps && my($var) = '';

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
creis@zehc.net (Helios de Creisquer) wrote:
>I used at beginning of script:
>	...
>	my($var) = '';
>	...
>I know this is a little dirty... everyway,
>It seems that when mod_perl encouter a 'my' statement,
>it doesn't evaluate it again next time the script is executed.



tainos@interfax.ru (Vasily Petrushin) wrote:
>my ($var) = ('');
>


That's not the problem.  See
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S .
It's a bit long, but thorough.  Especially see "The Remedy" section.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

Re: mod_perl_traps && my($var) = '';

Posted by Vasily Petrushin <ta...@interfax.ru>.
my ($var) = ('');

Vasily Petrushin
+7 (095) 2508363
http://www.interfax.ru
mailto:tainos@interfax.ru