Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Debugger question
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

Report this thread to moderator Post Follow-up to this message
Old Post
Red King
12-20-04 01:57 PM


Re: Debugger question
In 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/

Report this thread to moderator Post Follow-up to this message
Old Post
Peter Scott
12-20-04 08:56 PM


Re: Debugger question
Thanks 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>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Red King
12-21-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:02 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.