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(0x9c15edc)', '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_aspx23b607a20ab9eeadb11ecaf12050f211xINC() 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(0x9a1bc64)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b...') 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(0x9a1bc64)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9a433f4)') 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(0x9a1bc64); compiled: HASH(0x877b984); 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: 0d50f2e136b34ec530d8ceee9e43645c
  9. refreshing 0d50f2e136b34ec530d8ceee9e43645c with timeout 1283983479
  10. creating dbm for file /tmp/asp_demo/0d/0d50f2e136b34ec530d8ceee9e43645c, db MLDBM::Sync::SDBM_File, serializer: Data::Dumper
  11. session not expired - time: 1283983179; timeout: 1283983384;
  12. tieing session 0d50f2e136b34ec530d8ceee9e43645c
  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_incxd015f1bb72646cb6d317d7b6c92a7a65xINC code CODE(0x9c38e40)
  21. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incxd015f1bb72646cb6d317d7b6c92a7a65xINC]
  22. start parse of data - 1495
  23. undefing sub Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b607a20ab9eeadb11ecaf12050f211xINC code CODE(0x9c11918)
  24. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b607a20ab9eeadb11ecaf12050f211xINC]
  25. no stat: found cached code for include __ASP_l_proj_mlink_site_asp_eg_header_incxd015f1bb72646cb6d317d7b6c92a7a65
  26. register include /usr/local/proj/mlink/site/asp/eg/header.inc with success
  27. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  28. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  29. start parse of data - 116
  30. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC code CODE(0x9c0aabc)
  31. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC]
  32. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC code CODE(0x9c0aabc)
  33. register include compile_error.inc with error:
  34. Script_OnStart
  35. executing Script_OnStart
  36. [syntax_error.asp] - Script_OnStart /usr/local/proj/mlink/site/asp/eg/syntax_error.asp in global.asa
  37. executing Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b607a20ab9eeadb11ecaf12050f211xINC
  38. Script_OnFlush
  39. executing Script_OnFlush
  40. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  41. building headers
  42. sending cgi headers
  43. no stat: found cached code for include __ASP_l_proj_mlink_site_asp_eg_header_incxd015f1bb72646cb6d317d7b6c92a7a65
  44. executing Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incxd015f1bb72646cb6d317d7b6c92a7a65xINC
  45. Script_OnFlush
  46. executing Script_OnFlush
  47. [syntax_error.asp] - Script_OnFlush: about to flush 1036 bytes to client
  48. Script_OnFlush
  49. executing Script_OnFlush
  50. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  51. done executing include code Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incxd015f1bb72646cb6d317d7b6c92a7a65xINC
  52. Script_OnFlush
  53. executing Script_OnFlush
  54. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  55. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  56. Script_OnFlush
  57. executing Script_OnFlush
  58. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  59. Script_OnFlush
  60. executing Script_OnFlush
  61. [syntax_error.asp] - Script_OnFlush: about to flush 273 bytes to client
  62. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  63. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  64. start parse of data - 116
  65. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC code CODE(0x9c0aabc)
  66. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC]
  67. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx3398efc765bb5a66b2ac11949789690fxINC code CODE(0x9c0aabc)
  68. 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(0x9c15edc)', '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_aspx23b607a20ab9eeadb11ecaf12050f211xINC() 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(0x9a1bc64)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b...') 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(0x9a1bc64)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9a433f4)') 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
  69. ASP Done Processing Apache::ASP=HASH(0x9a1bc64) - Application: Apache::ASP::Application=HASH(0x9c1b308); GlobalASA: Apache::ASP::GlobalASA=HASH(0x898ff28); Internal: Apache::ASP::State=HASH(0x9c057fc); Request: Apache::ASP::Request=HASH(0x9766684); Response: Apache::ASP::Response=HASH(0x9c15edc); Server: Apache::ASP::Server=HASH(0x9c2e944); Session: Apache::ASP::Session=HASH(0x97663b4); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x9c0a894); compile_checksum: bdd88f74fe4f31092daafb79c0cd3830; compile_error: 1; compile_eval: SCALAR(0x9c0ee58); compile_includes: 1; compile_perl_count: 4; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x9a1bcd0); destroy: 1; dir_config: Apache::Table=HASH(0x9c17c10); dirname: /usr/local/proj/mlink/site/asp/eg/; errors_output: ARRAY(0x9c090a0); 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(0x9785304); includes_dir: ARRAY(0x9766768); init_packages: ARRAY(0x9c2e98c); inode_names: ; lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x9099c40); last_compile_include_data: HASH(0x9a415c4); last_time: 1283983179.6767; no_cache: ; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 4; pod_comments: 1; r: Apache=SCALAR(0x9a433f4); register_includes: HASH(0x9a40530); remote_ip: 38.107.191.111; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x904b92c); search_dirs_cache: HASH(0x9c0c16c); secure_session: ; session_cookie: 1; session_count: 1; session_id: 0d50f2e136b34ec530d8ceee9e43645c; session_serialize: ; session_state: 1; session_timeout: 300; session_url: ^(https://www\.nodeworks\.com|https://gate.corp.chamas.com); session_url_force: ; session_url_match: ^(https://www\.nodeworks\.com|https://gate.corp.chamas.com); session_url_parse: ^(https://www\.nodeworks\.com|https://gate.corp.chamas.com); session_url_parse_match: ^(https://www\.nodeworks\.com|https://gate.corp.chamas.com); start_time: 1283983179.65933; stat_inc: 0; stat_inc_match: 0; stat_scripts: 0; state_db: MLDBM::Sync::SDBM_File; 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: ;
  70. errors out
  71. 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(0x9c15edc)', '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_aspx23b607a20ab9eeadb11ecaf12050f211xINC() 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(0x9a1bc64)', 'Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx23b...') 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(0x9a1bc64)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9a433f4)') 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_incx3398efc765bb5a66b2ac11949789690fxINC {  ;; 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.