in reply to Devel::ptkdb, CGI script, Apache, WinXP -- why won't it work?

While I have not used this on XP, when I use ptkdb from Linux, or even from Win98 or Win2K when I was using them, I would not put the '-d:ptkdb' in the shebang line, but instead would launch the program from a command-line using the option, such as: perl -d:ptkdb testscript.cgi

I was not aware that it could be used in the way you are attempting. Might try it that way and see if it helps any.

Update: I went and looked at the documentation for Devel::ptkdb, and it had a BEGIN block that needed to be added when debugging CGIs. That may also be part of the issue. (The BEGIN block can be found in the documentation at the link for the module-I did not include it herein because I felt that documentation would be more current, and to prevent the possibility I might miscopy the information.)

Update: Might suggest setting the DISPLAY to ':0.0' and see if that makes a difference. I recall using Tk on Win* before, and it did not need an X session, but I can't recall if at the time I had to set the value for DISPLAY or not when I was working with that.

Update: I am glad you were able to find a solution to your issue. There is nothing bad in asking a question in good faith, for even answers in the negative at least prune away paths that do not have to be explored further, making reaching the solution that much quicker. As an instructor of mine was once fond of repeating, the only stupid question is the one everyone wants to know but is afraid to ask, which comes up later to bite you....

  • Comment on Re: Devel::ptkdb, CGI script, Apache, WinXP -- why won't it work?

Replies are listed 'Best First'.
Re: Re: Devel::ptkdb, CGI script, Apache, WinXP -- why won't it work?
by dpmott (Scribe) on Nov 18, 2002 at 20:39 UTC
    The example is overly simplified because it is stripped down from a bigger script (to demonstrate my problem).

    I will eventually be using ptkdb to figure out why the CGI::upload() method ($q->upload("filename")) doesn't seem to return a valid filehandle on WinXP (although the filename, when used as <$filename>, seems to work okay). Hmmm... maybe I should post that as a second question...

    Setting up the CGI environment by hand at the command line to simulate a file upload is a task that I'm not at all interested in attempting ;)

    Thanks, -Dave
Re: Re: Devel::ptkdb, CGI script, Apache, WinXP -- why won't it work?
by dpmott (Scribe) on Nov 18, 2002 at 20:49 UTC
    Yes, the BEGIN {} block is used on systems with X-Windows to forward the display to a remote computer. Unless WinXP has adopted an X-Windows environment (hey, I'm a novice on XP, it's possible), I don't think that this applies to me.

    Even so, I gave it a try with my best guess at a local display address ( $ENV{'DISPLAY'} = 'XXX.XX.X.XX:0.0';), but it still didn't work.

    I have recently used this technique to debug scripts on a Linux box via Exceed on a WinXP box, so it's good advice, just not (directly?) applicable to me.

    Thanks,
    -Dave