Apache::ASP Powered by ModPerl & Apache Powered by Apache::ASP Links Checked by NodeWorks
Demo ASP: syntax_error.asp 2010-09-07

We are creating a perl syntax error... this should demonstrate how error handling is done. Please check the error log file if you are interested in the output there.

You can turn this error messaging off by setting the Debug variable in the ASP config to 1 or 0.

Also here is an example of how you can use debugging, an API extension $Response->Debug(@args), in your script. The debug output will show up below, and in your error logs. This user style debugging is turned off with the same Debug setting set to 0.

Try this script also with buffering on.

This script by default does a runtime syntax error. If you would like to see a script compile error, click here.

view this file's source

Errors Output

  1. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/mlink/site/asp/eg/compile_error.inc line 5. Apache::ASP::Response::Include('Apache::ASP::Response=HASH(0x9187b34)', 'compile_error.inc') called at /usr/local/proj/mlink/site/asp/eg/syntax_error.asp line 55 Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC() called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 Apache::ASP::Execute('Apache::ASP=HASH(0x918271c)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6...') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1480 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1478 Apache::ASP::Run('Apache::ASP=HASH(0x918271c)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9182bcc)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1522
Debug Output
  1. RUN ASP (v2.61) for /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  2. GlobalASA package Apache::ASP::Demo
  3. creating dbm for file /tmp/asp_demo/server/internal, db SDBM_File, serializer: Data::Dumper
  4. creating dbm for file /tmp/asp_demo/server/application, db MLDBM::Sync::SDBM_File, serializer: Data::Dumper
  5. session id from cookie: 08e3dd6f099c25f05dcad9fc5444b8d9
  6. refreshing 08e3dd6f099c25f05dcad9fc5444b8d9 with timeout 1283852939
  7. creating dbm for file /tmp/asp_demo/08/08e3dd6f099c25f05dcad9fc5444b8d9, db SDBM_File, serializer: Data::Dumper
  8. session not expired - time: 1283852639; timeout: 1283852883;
  9. tieing session 08e3dd6f099c25f05dcad9fc5444b8d9
  10. updating LastSessionTimeout from 1283852913
  11. parse file /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  12. parsing /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  13. found header.inc at /usr/local/proj/mlink/site/asp/eg/header.inc
  14. runtime exec of dynamic include header.inc args ()
  15. start parse of data - 1495
  16. undefing sub Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC code CODE(0x9186b98)
  17. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC]
  18. register include /usr/local/proj/mlink/site/asp/eg/header.inc with success
  19. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  20. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  21. start parse of data - 116
  22. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x96da3fc)
  23. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  24. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x96da3fc)
  25. register include compile_error.inc with error:
  26. Script_OnStart
  27. executing Script_OnStart
  28. [syntax_error.asp] - Script_OnStart /usr/local/proj/mlink/site/asp/eg/syntax_error.asp in global.asa
  29. executing Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC
  30. Script_OnFlush
  31. executing Script_OnFlush
  32. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  33. building headers
  34. sending cgi headers
  35. executing Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC
  36. Script_OnFlush
  37. executing Script_OnFlush
  38. [syntax_error.asp] - Script_OnFlush: about to flush 1036 bytes to client
  39. Script_OnFlush
  40. executing Script_OnFlush
  41. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  42. done executing include code Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC
  43. Script_OnFlush
  44. executing Script_OnFlush
  45. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  46. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  47. Script_OnFlush
  48. executing Script_OnFlush
  49. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  50. Script_OnFlush
  51. executing Script_OnFlush
  52. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  53. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  54. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  55. start parse of data - 116
  56. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x96da3fc)
  57. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  58. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x96da3fc)
  59. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/mlink/site/asp/eg/compile_error.inc line 5. Apache::ASP::Response::Include('Apache::ASP::Response=HASH(0x9187b34)', 'compile_error.inc') called at /usr/local/proj/mlink/site/asp/eg/syntax_error.asp line 55 Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC() called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 Apache::ASP::Execute('Apache::ASP=HASH(0x918271c)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6...') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1480 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1478 Apache::ASP::Run('Apache::ASP=HASH(0x918271c)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9182bcc)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1522
  60. ASP Done Processing Apache::ASP=HASH(0x918271c) - Application: Apache::ASP::Application=HASH(0x9a4139c); GlobalASA: Apache::ASP::GlobalASA=HASH(0x9184e70); Internal: Apache::ASP::State=HASH(0x9185494); Request: Apache::ASP::Request=HASH(0x9185fc8); Response: Apache::ASP::Response=HASH(0x9187b34); Server: Apache::ASP::Server=HASH(0x9a40138); Session: Apache::ASP::Session=HASH(0x9185fa4); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x9a3ffe8); compile_checksum: ff296bd1061de32598ffbfab063ed1e9; compile_error: 1; compile_eval: SCALAR(0x9185fbc); compile_includes: 1; compile_perl_count: 3; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x904b9a4); destroy: 1; dir_config: Apache::Table=HASH(0x9186ac0); dirname: /usr/local/proj/mlink/site/asp/eg/; errors_output: ARRAY(0x9185d28); errs: 1; filename: /usr/local/proj/mlink/site/asp/eg/syntax_error.asp; global: /usr/local/proj/mlink/site/asp/eg//.; global_package: Apache::ASP::Demo; group_refresh: 30; headers_in: Apache::Table=HASH(0x877b984); includes_dir: ARRAY(0x9a248b0); init_packages: ARRAY(0x9184240); inode_names: ; lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x91825b4); last_compile_include_data: HASH(0x91861a8); last_time: 1283852639.7494; no_cache: ; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 3; pod_comments: 1; r: Apache=SCALAR(0x9182bcc); register_includes: HASH(0x9185d1c); remote_ip: 38.107.191.114; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x91877bc); search_dirs_cache: HASH(0x8474b54); secure_session: ; session_cookie: 1; session_count: 1; session_id: 08e3dd6f099c25f05dcad9fc5444b8d9; session_serialize: ; session_state: 1; session_timeout: 300; session_url: 1; session_url_force: ; session_url_match: ; session_url_parse: 0; session_url_parse_match: ; start_time: 1283852639.73766; stat_inc: 0; stat_inc_match: 0; stat_scripts: 1; state_db: ; state_dir: /tmp/asp_demo; state_manager: 10; state_serialize: ; state_serializer: ; ua: CCBot/1.0 (+http://www.commoncrawl.org/bot.html); use_strict: 1; win32: 0; xml_subs_match: my:\w+; xml_subs_perl_args: 1; xml_subs_strict: ; xslt: ;
  61. errors out
  62. error including compile_error.inc, not compiled: Bareword "code" not allowed while "strict subs" in use at /usr/local/proj/mlink/site/asp/eg/compile_error.inc line 5. Apache::ASP::Response::Include('Apache::ASP::Response=HASH(0x9187b34)', 'compile_error.inc') called at /usr/local/proj/mlink/site/asp/eg/syntax_error.asp line 55 Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC() called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1518 Apache::ASP::Execute('Apache::ASP=HASH(0x918271c)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6...') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1480 eval {...} called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1478 Apache::ASP::Run('Apache::ASP=HASH(0x918271c)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9182bcc)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 1522
Compiled Data with Error 

  -: package Apache::ASP::Demo; ;; sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC {  ;; package Apache::ASP::Demo; ;; use strict;;;use vars qw($Application $Session $Response $Server $Request);;
  -: #line 1 /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  1: ;;&Apache::ASP::WriteRef($main::Response, \('
  2: This next code block contains invalid perl code that will
  3: generate a compile time error.
  4: ')); 
  5:  invalid perl code;
  6: ;  ;; }


An error has occured with the Apache::ASP script just run. If you are the developer working on this script, and cannot work through this problem, please try researching it at the Apache::ASP web site, specifically the FAQ section. Failing that, check out your support options, and if necessary include this debug output with any query.