Q7: How do I test if a script is working?

Answer

Several ways to test your CGI scripts:

  1. Direct browser access:
    http://yourdomain.com/cgi-bin/script.pl
  2. Command line test:
    perl -c script.pl  # Check syntax
    perl script.pl      # Run directly
  3. Check error logs: Look at your server's error_log file
  4. Add debugging:
    use CGI::Carp qw(fatalsToBrowser);
Note: Remove fatalsToBrowser in production for security.
Previous General FAQ Next