[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Debugging perl (about the thread "Server Hacked?")



Ahoy Ariel

You write:

>I'm trying to debug a perl script, I get an "internal server error" on the
>browser (as usual). I probably forgot some stupid ; or }, but the only way
>to know what's wrong is using telnet to run the script on the server, and
>get the error. But I don't want to give telnet access to my users (see the
>"Server Hacked?" thread). "debugging perl script" seems to be the only
>reason to give telnet access to the users, so: Is there any way to get the
>errors of the perl script on the browser? Maybe using #!/usr/bin/perl
>-<something>..
>
>I tryed:
>
>using the #exec command on a shtml file to run the script
>usgin the #exec command on a shtml file to run "nohup <script>" and get the
>result on nohup.out (not very secure either)
>
>Nothing worked.. Any suggetions?


Ariel, two suggestions, equally important:


1) Be prepared

Maybe this is too simple, but -----
Why don't you debug the darn thing BEFORE you put it on the server?

Install Perl for Win32 from ActiveState
Launch the script with a trailing "-e" from, say, PFE, which will capture
the
output in a window. Get what would otherwise be your form input by
inserting an associative array thus:
       %input = ('name1','value1','name2','value2');

If you wish, you can then copy and paste the output into an html document,
and look at it with your browser.

It's easy. Really. And that way, your script is prepared before
installation.

If you need help with any of this, I will send you detailed instructions.



2) Be careful

I would also suggest (and please take this the right way) that any
programmer,
Perl or otherwise, practice meticulous spelling, grammar, and orthography in
everything we write. Think about it. If you habitually proofed your mail to
correct
"tryed" and "usgin" before you sent it, then you would be more apt to
habitually proof your scripts for stupid "{"s and ";"s, BEFORE you FTPd
them.
Why? Then you wouldn't habitually get an internal server error "(as usual)".

It's folly to think that we can turn careful habits on and off like a
switch. The
various facets of our lives must have some consistency. Stuff matters.
Good habits get good results. It makes sense.

Years ago, in another life, I installed custom yacht joinery for a living.
After
several years of this, I discovered one day that I had developed the careful
habit  of putting a rag in my pocket BEFORE mixing the glue. That's when
I knew I had begun to master the art of joinery.




My motto is:

Proper Perl programming is a pretty persnicketty pastime.

Aloha
Davis