Debugging CGI under NT... 
Author Message
 Debugging CGI under NT...

Hello,

Me and a friend were debugging a CGI script under NT 4 and noticed some odd
behavior. The first thing is that while debugging the script we entered the
the name=value pairs for the CGI we couldn't get the script to continue. On
my linux box typing cntl-d ends the input of the name-value pairs and the
debugging session continues. We were using Activesite build 519. We couldn't
find any way to continue execution. We found no clues under perldoc CGI.
What is done at this point?

The second problem is it seems that under NT perl doesn't support command
line arguments. Regardless of the number of command line arguments #$ARGV
always equals -1! I wrote a test script and seen it for my self, I wouldn't
have thought it otherwise.

So whats going on? Other than doing this on NT? btw we got the debugging
done by telneting to my machine and doing the work

Thanks, Matthew

reply here, to email edit my address.

--
A prohibitionist is the sort of man one wouldn't care to drink with --
even if he drank. -- H.L. Mencken



Sat, 27 Apr 2002 03:00:00 GMT  
 Debugging CGI under NT...
: Me and a friend were debugging a CGI script under NT 4 and noticed some odd
: behavior. The first thing is that while debugging the script we entered the
: the name=value pairs for the CGI we couldn't get the script to continue. On
: my linux box typing cntl-d ends the input of the name-value pairs and the
: debugging session continues. We were using Activesite build 519. We couldn't
: find any way to continue execution. We found no clues under perldoc CGI.
: What is done at this point?

Use Ctrl-z to indicate EOF.

: The second problem is it seems that under NT perl doesn't support command
: line arguments. Regardless of the number of command line arguments #$ARGV
: always equals -1! I wrote a test script and seen it for my self, I wouldn't
: have thought it otherwise.

Try running the script by "perl name_of_script" rather than just
"name_of_script."  NT's command processor has some rather peculiar ideas
about what command-line info to pass to a program invoked through file
associations.



Sat, 27 Apr 2002 03:00:00 GMT  
 Debugging CGI under NT...

Quote:

>Use Ctrl-z to indicate EOF.

Hey, thank you, thats it. Honestly I knew that but it's been so long since
I had to know it that I had forgotten it...

Quote:

>Try running the script by "perl name_of_script" rather than just
>"name_of_script."  NT's command processor has some rather peculiar ideas
>about what command-line info to pass to a program invoked through file
>associations.

Thanks I'll try that.

Matthew



Sat, 27 Apr 2002 03:00:00 GMT  
 Debugging CGI under NT...
There is another workarround: Simply pass your name=value pairs as simple
arguments like this:

perl cgiscript.pl todo=list name=nobody

This is more comfortable since your have a faster workflow.

Have fun,
M. Uenalan

Quote:

> Hello,

> Me and a friend were debugging a CGI script under NT 4 and noticed some odd
> behavior. The first thing is that while debugging the script we entered the
> the name=value pairs for the CGI we couldn't get the script to continue. On
> my linux box typing cntl-d ends the input of the name-value pairs and the
> debugging session continues. We were using Activesite build 519. We couldn't
> find any way to continue execution. We found no clues under perldoc CGI.
> What is done at this point?

> The second problem is it seems that under NT perl doesn't support command
> line arguments. Regardless of the number of command line arguments #$ARGV
> always equals -1! I wrote a test script and seen it for my self, I wouldn't
> have thought it otherwise.

> So whats going on? Other than doing this on NT? btw we got the debugging
> done by telneting to my machine and doing the work

> Thanks, Matthew

> reply here, to email edit my address.

> --
> A prohibitionist is the sort of man one wouldn't care to drink with --
> even if he drank. -- H.L. Mencken



Tue, 30 Apr 2002 03:00:00 GMT  
 Debugging CGI under NT...
I use another approach:

    if (defined $cgi_dbg && $ENV{'CGI_SCRIPT_DEBUG'}) {
        open CGI_DBG, "<$cgi_dbg" or die "Can't open $cgi_dbg: $!";
        $cgi = new CGI(\*CGI_DBG);
        close CGI_DBG;
    } else {
        $cgi = new CGI;
        if (defined $cgi_dbg) {
            open CGI_DBG, ">$cgi_dbg" or die "Can't open $cgi_dbg: $!";
            $cgi->save(\*CGI_DBG);
            close CGI_DBG;
        }
    }

That is, I pass the arguments online via the intended interface, and debug
in a second pass on the command line (where I define the environment variable
CGI_SCRIPT_DEBUG).

When I get the script straight, I set $cgi_dbg to undef.

cu,
  Martin
--
                       |  Martin Vorlaender  |  VMS & WNT programmer

  KNOW where you want  |        http://www.pdv-systeme.de/users/martinv/



Wed, 01 May 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Debugging CGI under NT...

2. Perl (v 5.001) Debugging under NT

3. Need Help - Perl on Win95/NT, problem with debugging

4. Debugging in NT with perl?

5. ANNOUNCE: centralized debug and user feedback logging CGI::Log

6. Debugging Arrays in CGI.pm?

7. tool to debug CGI?

8. Debugging CGI programs

9. PTKDB PERL debugger problems when debugging cgi script - code pane font not readable

10. Debugging cgi/perl

11. debug in cgi environment (indigoperl) ?

12. How do you debug cgi scripts?!

 

 
Powered by phpBB® Forum Software