SPUG: generating output with a cgi script

Doug Beaver dougb at scalar.org
Mon Oct 2 19:07:08 CDT 2000


On Mon, Oct 02, 2000 at 02:40:46PM -0700, Wu, Yaoxi wrote:
> 
> Thank everyone for the suggestions and hints! With your help, I have
> fixed the problems and my script is working!
 
> By the way, does anyone know a debugger program available for perl?
> Something similar to DDD for C?

ddd does support perl, although I've never used it before.  There is
also a tk-based perl debugger named Devel::ptkdb, you can find it on
CPAN.

Perl also has a builtin command-line debugger that is similar to gdb,
you enable it by passing the -d switch to perl.  perldoc perldebug for
more info, it's very useful.  You should know how to use the
command-line debugger even if you end up using ddd, you never know when
you'll have to debug perl code running on a machine without X on it.

Doug

> Again, thank you all so much for the help!
> 
> YW
> 
> 
> -----Original Message-----
> From: JP Montagnet [mailto:jope at n2h2.com]
> Sent: Monday, October 02, 2000 11:01 AM
> To: Wu, Yaoxi
> Subject: Re: SPUG: generating output with a cgi script
> 
> 
> On Mon, 2 Oct 2000, Wu, Yaoxi wrote:
> > This thing is driving me crazy; I hope someone can enlighten me.
> > Please look at the following short cgi script:
> > 
> > #!/usr/bin/perl -wT
> > use CGI;
> > $cgi = new CGI;
> > print $cgi->header("text/plain");
> > open(DB_FILE, "test.bib");
> > undef $/;
> > $line=<DB_FILE>;
> > close DB_FILE;
> 
> My guess is that your open() statement failed, because you specified the
> file relative to whatever the current directory is.  When your script is
> running as a CGI scrpt, that very well may not be the same directory the
> script is in.  Either fully qualify your file location, or add a chdir()
> prior to the open().  CHeckingthe return code from your open() is always
> a good idea too.
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>   Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
> 
> 

-- 
Smithers: I'm afraid we have a bad image, Sir.  Market research shows
          people see you as somewhat of an ogre.
   Burns: I ought to club them and eat their bones!

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list