in reply to Re^3: Google Images via CGI
in thread Google Images via CGI

Outing myself as a total novice: How do I debug a cgi? Beyond checking beforehand with perl -wc my_program.pl and sending any errors to a file with use CGI::Carp qw(carpout);, what options do I have? Is there a way to run a cgi with -d in the shell, even though the cgi needs user input to get to the problematic lines of code?

Replies are listed 'Best First'.
Re^5: Google Images via CGI
by Anonymous Monk on Sep 03, 2009 at 11:06 UTC
    Since WebService::Simple->isa('LWP::UserAgent') you can use
    $google->add_handler("request_send", sub { shift->dump; return }); $google->add_handler("response_done", sub { shift->dump; return });
    I was going to suggest you use the WebService::Simple->new( debug => 1 ...) option, but it wouldn't have helped. I would switch to WWW::Mechanize (or WWW::Mechanize::Cached), its much better in all respects.