Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Who modifies $ENV{PATH}?

by tobyink (Abbot)
on Dec 06, 2012 at 10:35 UTC ( #1007524=note: print w/ replies, xml ) Need Help??


in reply to Who modifies $ENV{PATH}?

You could try adding the following right at the top of your script. (Even add it before use strict - before everything else except perhaps the #! line.)

BEGIN { package Tie::Env::Warn; use Carp qw(cluck); use Tie::Hash; our @ISA = 'Tie::StdHash'; sub STORE { my ($self, $key, $value) = @_; cluck "Modification of \$ENV{$key}!"; $self->SUPER::STORE($key, $value); } tie %ENV, __PACKAGE__; };

That will print out a warning including a stack trace (which shows line numbers, etc) whenever %ENV values are assigned. If that doesn't help, then you could also try hooking the DELETE and CLEAR methods (the example above just hooks STORE).

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Who modifies $ENV{PATH}?
Select or Download Code
Replies are listed 'Best First'.
Re^2: Who modifies $ENV{PATH}?
by Anonymous Monk on Dec 07, 2012 at 06:52 UTC

    Thank you. Found the culprit: Date/Manip/TZ.pm version 6.34 line 96. Looks like it's fixed in 6.37 (the latest on CPAN).

    Relieved!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007524]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-28 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls