vi_srikanth has asked for the wisdom of the Perl Monks concerning the following question:

Hi

Using ptkdb I would like to debug my CGI script. My server and client are same machine only. This is my script:

#!/usr/local/bin/perl -d:ptkdb BEGIN { $ENV{'DISPLAY'} = "10.40.14.106:0.0"; } Then my code . . .

But, if I open the script in my web browser, I am not getting any ptkdb window. The page just gets loaded as usual. ptkdb works fine at command line, but it is not showing up when i access the cgi thru browser.

This is what I have configured for the xhost in my system:

 xhost
 access control anabled, only authorized clients can connect
 INET:10.40.14.106
 (where 10.40.14.106 is my ip)

Any help is greatly appreciated.

Thanks
Srikanth

Replies are listed 'Best First'.
Re: ptkdb for CGI script
by Moron (Curate) on Apr 12, 2007 at 14:18 UTC
    ^B %ENV is only a copy of the parent's environment not the real thing.

    ^I You need a ksh wrapper that assigns and exports the DISPLAY environment variable before running the debugger program.

    __________________________________________________________________________________

    ^M Free your mind!

    Key to hats: ^I=white ^B=black ^P=yellow ^E=red ^C=green ^M=blue - see Moron's scratchpad for fuller explanation.