On Thursday, Jun 5, 2003, at 21:43 US/Pacific, Mark Young wrote: [..]

One nice way to learn about hashes, arrays, scalars and references, is to learn the perl debugger and just experiment.

There is a perl debugger tutorial in the perl documentation.

[..]

My Compliments!

        cf      perldoc perldebug
                perldoc perldebtut

folks would also be wise to check out

perldoc Data::Dumper

since these will help the user sort out whether the problem
is with some piece of perl arcania, or is it really the more
complex problem of how their cgi code is working!

Folks should never be afraid to just write a little piece of
perl, whip it in the debugger, and see if it is doing what
must be done...

To help 'debug' the "html" side of the problem, one either
needs to have

        a. their web-server set to full debug mode,
                and tail the logfile

b. cut a simple mini-web-server that is in debug mode

c. run simple scripts to act like a web-server...

To help, I have a small /bin/sh script I use:

vladimir: 57:] sed 's/^/###/' ~/bin/test_cgi
####!/bin/sh
###
###METHOD=$1
###SCRIPT=$2
###QUERY_STRING=$3
###DEBUG=$4
###
###REQUEST_METHOD=${METHOD}
###dir=`pwd`
###dir=`echo $dir | sed s'!.*\(/home\)!\1!'`
###SCRIPT_FILENAME="${dir}/$SCRIPT"
###
###export REQUEST_METHOD SCRIPT_FILENAME QUERY_STRING
###
####echo "<${METHOD}> <${SCRIPT}> <${DEBUG}>"
###
###perl ${DEBUG} $SCRIPT
vladimir: 58:]

which I call with

test_cgi GET <name_of_script> <query_string> [ -d ]

say :

vladimir: 62:] test_cgi GET index.cgi "callForm=bob&fran=zoie"
Content-Type: text/html
Content-Length: 487

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>HQ Admin Web Tool on vladimir</title></head>
<frameset border="0" cols="135,*" frameborder="no" framespacing="0">
<frameset border="0" rows="97,*" frameborder="no" framespacing="0">
<frame name="HqIcon" scrolling="no" src="html/icon.html">
<frame name="VertNav" src="L1/L1_VertNav.cgi">
</frameset>
<frame name="MainBody" src="L1/L1_MainBody.cgi?callForm=bob&fran=zoie">
</frameset></html>
vladimir: 63:]


So that it 'acts' like a mini-web-server, the
'-d' option of course would take us into the perl debugger itself...

This will help get past the usual 'issues' with debugging
perl cgi scripts, that want to have one 'input' stuff
and type ^D or echo the query string in....

Your mileage may vary....

ciao
drieux

---

short shameful confession: It has been a long time since I
have actually used a command line debugger for things like 'c' code,
but fell into the need a while back, and myFascistHouseMate said,

'just use the gdb at the command line'

and I did and laughed,

"hey, it's just like the perl debugger..."

and my professional peers all began to cry and
move away from me on the Group W bench.....



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to