Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Detect variable change?

by tospo (Hermit)
on Apr 20, 2011 at 08:38 UTC ( #900291=note: print w/replies, xml ) Need Help??

in reply to Detect variable change?

You could achieve this with the Perl debugger. The trick is to get an interactive debugger session into your CGI script as you interact with it through a web page. I do this with Catalyst apps and it fires of a terminal on my system when the code encounters a "$DB::single=1;" line. I'm not sure exactly how to acheive this with a simple CGI script but this thread here Debugging CGI/PERL has some advice on that.
Once you have the debugger session you can monitor a variable by setting a watch expression (w NAME_OF_VARIABLE), which will be triggered whenever the value of the variable changes.

Replies are listed 'Best First'.
Re^2: Detect variable change?
by LanX (Bishop) on Apr 20, 2011 at 15:25 UTC
    IIRC Devel::ptkdb can be used for CGIs:

    ... from the docs

    Sets the X display that the ptkdb window will appear on when invoked. Useful for debugging CGI scripts on remote systems.

    Cheers Rolf

    UPDATE: see Re: Debugging CGI/PERL

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900291]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2018-06-21 01:51 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.