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

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(0x9184c6c)', '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(0x9183f28)', '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(0x9183f28)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9180ff4)') 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. global.asa was not cached for __ASP__usr_local_proj_mlink_site_asp_eg__x00af84ec606339cdd7bd51c7f4b07c30xApache::ASP::Demo
  4. compiling global.asa Apache::ASP::Demo __ASP__usr_local_proj_mlink_site_asp_eg__x00af84ec606339cdd7bd51c7f4b07c30xApache::ASP::Demo exists 1 - asp: Apache::ASP=HASH(0x9183f28); compiled: HASH(0x91849c0); exists: 1; package: Apache::ASP::Demo; - --- - exists: 0; mtime: 0;
  5. global.asa routines - Application_OnEnd: 1; Application_OnStart: 1; Script_OnEnd: 1; Script_OnFlush: 1; Script_OnStart: 1; Session_OnEnd: 1; Session_OnStart: 1;
  6. creating dbm for file /tmp/asp_demo/server/internal, db SDBM_File, serializer: Data::Dumper
  7. creating dbm for file /tmp/asp_demo/server/application, db MLDBM::Sync::SDBM_File, serializer: Data::Dumper
  8. session id from cookie: 022e7e404f7829a4f9186996a2d867c3
  9. refreshing 022e7e404f7829a4f9186996a2d867c3 with timeout 1283939405
  10. creating dbm for file /tmp/asp_demo/02/022e7e404f7829a4f9186996a2d867c3, db SDBM_File, serializer: Data::Dumper
  11. session not expired - time: 1283939105; timeout: 1283939384;
  12. tieing session 022e7e404f7829a4f9186996a2d867c3
  13. parse file /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  14. parsing /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  15. found header.inc at /usr/local/proj/mlink/site/asp/eg/header.inc
  16. runtime exec of dynamic include header.inc args ()
  17. parse file /usr/local/proj/mlink/site/asp/eg/header.inc
  18. parsing /usr/local/proj/mlink/site/asp/eg/header.inc
  19. start parse of data - 1320
  20. undefing sub Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC code CODE(0x9185eb4)
  21. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC]
  22. start parse of data - 1495
  23. undefing sub Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC code CODE(0x9185d34)
  24. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC]
  25. register include /usr/local/proj/mlink/site/asp/eg/header.inc with success
  26. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  27. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  28. start parse of data - 116
  29. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9186754)
  30. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  31. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9186754)
  32. register include compile_error.inc with error:
  33. Script_OnStart
  34. executing Script_OnStart
  35. [syntax_error.asp] - Script_OnStart /usr/local/proj/mlink/site/asp/eg/syntax_error.asp in global.asa
  36. executing Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC
  37. Script_OnFlush
  38. executing Script_OnFlush
  39. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  40. building headers
  41. sending cgi headers
  42. executing 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 1036 bytes to client
  46. Script_OnFlush
  47. executing Script_OnFlush
  48. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  49. done executing include code Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC
  50. Script_OnFlush
  51. executing Script_OnFlush
  52. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  53. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  54. Script_OnFlush
  55. executing Script_OnFlush
  56. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  57. Script_OnFlush
  58. executing Script_OnFlush
  59. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  60. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  61. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  62. start parse of data - 116
  63. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9186754)
  64. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  65. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9186754)
  66. 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(0x9184c6c)', '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(0x9183f28)', '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(0x9183f28)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9180ff4)') 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
  67. ASP Done Processing Apache::ASP=HASH(0x9183f28) - Application: Apache::ASP::Application=HASH(0x9182800); GlobalASA: Apache::ASP::GlobalASA=HASH(0x9184624); Internal: Apache::ASP::State=HASH(0x9182a10); Request: Apache::ASP::Request=HASH(0x82c1e78); Response: Apache::ASP::Response=HASH(0x9184c6c); Server: Apache::ASP::Server=HASH(0x9184d08); Session: Apache::ASP::Session=HASH(0x87c4c68); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x91824e8); compile_checksum: ff296bd1061de32598ffbfab063ed1e9; compile_error: 1; compile_eval: SCALAR(0x91867fc); compile_includes: 1; compile_perl_count: 4; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x9183a54); destroy: 1; dir_config: Apache::Table=HASH(0x918112c); dirname: /usr/local/proj/mlink/site/asp/eg/; errors_output: ARRAY(0x9186a6c); 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(0x91811ec); includes_dir: ARRAY(0x91839f4); init_packages: ARRAY(0x9184cb4); inode_names: ; lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x9184660); last_compile_include_data: HASH(0x9185ec0); last_time: 1283939105.6464; no_cache: ; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 4; pod_comments: 1; r: Apache=SCALAR(0x9180ff4); register_includes: HASH(0x9185f98); remote_ip: 38.107.191.86; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x9185f08); search_dirs_cache: HASH(0x9185d40); secure_session: ; session_cookie: 1; session_count: 1; session_id: 022e7e404f7829a4f9186996a2d867c3; 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: 1283939105.39555; 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: ;
  68. errors out
  69. 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(0x9184c6c)', '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(0x9183f28)', '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(0x9183f28)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9180ff4)') 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.