You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Balázs Szabó (dLux)" <dl...@dlux.hu> on 2005/11/01 14:09:03 UTC

Re: TZ variable and mod_perl

Hi,

Tyler, thank you for the answer, I tried it, and it worked!

Although I am a little bit worried about the ithreads issues with this.
As I read the perlthrtut, it seems that using this module is most
probably will change the whole process' environment, so another
paralelly served request can be affected as well, right? I am asking it,
because I don't know how mod_perl works.

If the user uses a non-threaded MPM, then even if the libperl uses
ithreads, then I guess one apache process only serves one request, so it
must not be a problem, right?

But I guesst with a threaded MPM, setting the TZ environment variable is
not a good idea, since it can affect other running requests.

Are my assumptions right? Can someone confirm them? I would like to put
some warning to the documentation of my module, and tweak it to use as
less tzset as possible...

Thanks in adnvance,

Balázs

Tyler MacDonald wrote:

>	I had to use Env::C to accomplish this;
>
>sub set_tz_env {
>    my($class, $tz) = @_;
>    Env::C::setenv('TZ', $tz);
>    $ENV{TZ} = $tz;
>    POSIX::tzset();
>}
>  
>
-- 

Szabó Balázs (dLux)
--   --  - - - -- -



Re: TZ variable and mod_perl

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2005-11-01 at 14:09 +0100, "Balázs Szabó (dLux)" wrote:
> As I read the perlthrtut, it seems that using this module is most
> probably will change the whole process' environment, so another
> paralelly served request can be affected as well, right?

It depends.  Take a look at this:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code

- Perrin