I think that a fresh new copy of the module is loaded into memory everytime it
is called. That's why your module loses its value. If I want to do something
like that, I'd consider storing the value on the hard drive somewhere.

Vishal


Quoting David Gama Rodrí­guez <[EMAIL PROTECTED]>:

> Hello everyone !!
> 
> I'm really a newbie developing perl modules. I have and issue
> 
> I made a module that loads when Apache starts, in my module I declare a 
> hash  as a global in order to be accesed in any place in my module,
> 
> my $hash;
> 
> 
> sub x{
>  $foo = shift;
> ......
> ......
>  $hash->{x} = $foo;
> }
> 
> 
> sub y{
> ....
> ....
> print $hash->{x};
> }
> 
> 
> in a webapageX I call the x sub and another webpageY I call y sub, I 
> access webpageX once to put some value to the $hash so the trouble 
> starts when I'm access the webpageY  from diferent locations and $hash 
> lost its value declare in webpageX
> 
> I suppose that when I initialice the module when Apache starts it will 
> hold that $hash variable available for every page that calls that 
> module, is that right ? or ervrytime that it calls webpageY is a new 
> instance of the module???
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 




----------------------------------------
This mail sent through www.mywaterloo.ca

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to