Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, There is a script that "uses" a couple of modules and one of those modules is setting an environmental variable. I need to determine which of the used modules is doing that. Could someone let me know how I should use the debugger to find this? That is, script.pl does something like: use ModuleA; use ModuleB; use ModuleC; use ModuleD; I need to determine whether it is ModuleA or ModuleB or ModuleC or ModuleD which is setting an environmental variable FOO? I looked at "man perldebug" but couldn't deduce anything useful. Thanks in advance, Amit
Post Follow-up to this messageIn article <bd837f8e04122001334c809d9b@mail.gmail.com>,
redcodemonk@gmail.com (Red King) writes:
>There is a script that "uses" a couple of modules and one of those
>modules is setting an environmental variable. I need to determine
>which of the used modules is doing that. Could someone let me know how
>I should use the debugger to find this?
>
>That is, script.pl does something like:
>
>use ModuleA;
>use ModuleB;
>use ModuleC;
>use ModuleD;
>
>I need to determine whether it is ModuleA or ModuleB or ModuleC or
>ModuleD which is setting an environmental variable FOO?
Insert the line
BEGIN { $DB::single = 1 }
before those use statements and run under the debugger.
You should be able to set a watchpoint on $ENV{WHATEVER} to
make the search go faster.
--
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/
Post Follow-up to this messageThanks Peter! That solved my problem.
Regards,
Amit
On 20 Dec 2004 16:36:27 -0000, Peter Scott <peter@psdt.com> wrote:
> In article <bd837f8e04122001334c809d9b@mail.gmail.com>,
> redcodemonk@gmail.com (Red King) writes:
>
> Insert the line
>
> BEGIN { $DB::single = 1 }
>
> before those use statements and run under the debugger.
>
> You should be able to set a watchpoint on $ENV{WHATEVER} to
> make the search go faster.
>
> --
> Peter Scott
> http://www.perldebugged.com/
> *** NEW *** http://www.perlmedic.com/
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.