Professional Web Applications Themes

debugging - PERL Miscellaneous

"superfly2" <com> wrote in message news:<bkfpl5$9aq$Stanford.EDU>...  I don't know if this will work for what you're doing, but one helpful trick I've been using is to wrap all my "interesting" script code in an eval block, then trap the error message and shunt it to an error page. eval { <CODE> }; whineAndDie($) if $; .. . . where "whineAndDie" is a subroutine that logs the error message and sends the user an error page with that error message featured prominently. Makes it a hell of a lot easier to diagnose unexpected runtime errors. -- Pete Butler...

  1. #1

    Default Re: debugging

    "superfly2" <com> wrote in message news:<bkfpl5$9aq$Stanford.EDU>... 

    I don't know if this will work for what you're doing, but one helpful
    trick I've been using is to wrap all my "interesting" script code in
    an eval block, then trap the error message and shunt it to an error
    page.

    eval {
    <CODE>
    };
    whineAndDie($) if $;

    .. . . where "whineAndDie" is a subroutine that logs the error message
    and sends the user an error page with that error message featured
    prominently.

    Makes it a hell of a lot easier to diagnose unexpected runtime errors.

    -- Pete Butler
    Pete Guest

  2. #2

    Default Re: debugging

    superfly2 wrote:
     


    Wrong.


    This is a FAQ. Please check:

    perldoc -q 500

    and follow everything there and in all the places to which it refers you
    to the letter. If you still have trouble, ask again indicating you have
    done all that. Hint: the error message above is from your web server,
    not from Perl. Your web server expects headers and then a null line
    from your script; it isn't getting that. Maybe because the script
    didn't compile; maybe because it didn't output the right stuff -- it's
    all the same to the web server -- all it knows or cares about is that it
    didn't get the right stuff from your script.

    BTW, debugging CGI stuff is considered off-topic for this newsgroup (the
    issues would be the same if your script was written in C, DOS batch
    file, etc). You might have better luck at
    comp.infosystems.www.authoring.cgi .

    --
    Bob Walton

    Bob Guest

  3. #3

    Default Re: debugging

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    "superfly2" <com> wrote in
    news:bkfpl5$9aq$Stanford.EDU:
     

    The excellent ptkdb debugger is wonderful for debugging CGI programs.
    Google for 'ptkdb' to find it. Its doentation includes instructions for
    running CGI programs under ptkdb -- you click on a link in your browser,
    and ptkdb pops up on your terminal and allows you to single-step, examine
    and change variables, etc.

    - --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP20HC2PeouIeTNHoEQLpAACg+kHZnV7WLlnjmKHCeAixUl AZ5CcAnR/T
    PsjY7CiSbyzIPGTDz7cVHK2e
    =oAk2
    -----END PGP SIGNATURE-----
    Eric Guest

Similar Threads

  1. Debugging output does not appear when use Debugging IPAddresses
    By Schroeder2 in forum Coldfusion Server Administration
    Replies: 2
    Last Post: June 7th, 11:15 PM
  2. Debugging
    By Andrew Durstewitz in forum ASP
    Replies: 15
    Last Post: May 10th, 02:53 AM
  3. cf debugging
    By Dan Bracuk in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: September 30th, 07:41 PM
  4. VI Debugging
    By Scott in forum ASP
    Replies: 1
    Last Post: October 22nd, 12:28 PM
  5. debugging with gdb
    By Paul Pluzhnikov in forum UNIX Programming
    Replies: 0
    Last Post: August 5th, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139