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

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(0x9c334cc)', '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(0x9182488)', '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(0x9182488)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9c24e04)') 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(0x9182488); compiled: HASH(0x9c35320); 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: 0b14d37a2b2d3174d9f42f6d48bdc630
  9. refreshing 0907acb90f7ceff9d9c36ecaedeae879 with timeout 1284054972
  10. new session id 0907acb90f7ceff9d9c36ecaedeae879
  11. creating dbm for file /tmp/asp_demo/09/0907acb90f7ceff9d9c36ecaedeae879, db SDBM_File, serializer: Data::Dumper
  12. tieing session 0907acb90f7ceff9d9c36ecaedeae879
  13. clearing starting session
  14. Session_OnStart - session: 0907acb90f7ceff9d9c36ecaedeae879;
  15. executing Session_OnStart
  16. updating LastSessionTimeout from 1284054918
  17. parse file /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  18. parsing /usr/local/proj/mlink/site/asp/eg/syntax_error.asp
  19. found header.inc at /usr/local/proj/mlink/site/asp/eg/header.inc
  20. runtime exec of dynamic include header.inc args ()
  21. parse file /usr/local/proj/mlink/site/asp/eg/header.inc
  22. parsing /usr/local/proj/mlink/site/asp/eg/header.inc
  23. start parse of data - 1320
  24. undefing sub Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC code CODE(0x9a516c0)
  25. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC]
  26. start parse of data - 1495
  27. undefing sub Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC code CODE(0x9c3038c)
  28. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC]
  29. register include /usr/local/proj/mlink/site/asp/eg/header.inc with success
  30. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  31. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  32. start parse of data - 116
  33. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9c2d788)
  34. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  35. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9c2d788)
  36. register include compile_error.inc with error:
  37. Script_OnStart
  38. executing Script_OnStart
  39. [syntax_error.asp] - Script_OnStart /usr/local/proj/mlink/site/asp/eg/syntax_error.asp in global.asa
  40. executing Apache::ASP::Demo::__ASP__mlink_site_asp_eg_synta__error_aspx8b6c7882356f519fda94ea81f47734efxINC
  41. Script_OnFlush
  42. executing Script_OnFlush
  43. [syntax_error.asp] - Script_OnFlush: about to flush 1 bytes to client
  44. building headers
  45. sending cgi headers
  46. executing Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC
  47. Script_OnFlush
  48. executing Script_OnFlush
  49. [syntax_error.asp] - Script_OnFlush: about to flush 1036 bytes to client
  50. Script_OnFlush
  51. executing Script_OnFlush
  52. [syntax_error.asp] - Script_OnFlush: about to flush 82 bytes to client
  53. done executing include code Apache::ASP::Demo::__ASP_l_proj_mlink_site_asp_eg_header_incx24bd1b50626504c18134bcd2c77446fcxINC
  54. Script_OnFlush
  55. executing Script_OnFlush
  56. [syntax_error.asp] - Script_OnFlush: about to flush 537 bytes to client
  57. [syntax_error.asp] - Debugging - can; take - just: about; - any; kind - of reference - or scalar
  58. Script_OnFlush
  59. executing Script_OnFlush
  60. [syntax_error.asp] - Script_OnFlush: about to flush 77 bytes to client
  61. Script_OnFlush
  62. executing Script_OnFlush
  63. [syntax_error.asp] - Script_OnFlush: about to flush 269 bytes to client
  64. parse file /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  65. parsing /usr/local/proj/mlink/site/asp/eg/compile_error.inc
  66. start parse of data - 116
  67. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9c2d788)
  68. compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC]
  69. undefing sub Apache::ASP::Demo::__ASP_mlink_site_asp_eg_compile_error_incx87ca4f3817507604073b2da577c9bbd0xINC code CODE(0x9c2d788)
  70. 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(0x9c334cc)', '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(0x9182488)', '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(0x9182488)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9c24e04)') 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
  71. ASP Done Processing Apache::ASP=HASH(0x9182488) - Application: Apache::ASP::Application=HASH(0x9a5026c); GlobalASA: Apache::ASP::GlobalASA=HASH(0x9c211a0); Internal: Apache::ASP::State=HASH(0x9c21068); Request: Apache::ASP::Request=HASH(0x9c264dc); Response: Apache::ASP::Response=HASH(0x9c334cc); Server: Apache::ASP::Server=HASH(0x9c35098); Session: Apache::ASP::Session=HASH(0x9c1f930); app_state: 1; basename: syntax_error.asp; cleanup: ARRAY(0x9182d28); compile_checksum: ff296bd1061de32598ffbfab063ed1e9; compile_error: 1; compile_eval: SCALAR(0x9769ef0); compile_includes: 1; compile_perl_count: 4; cookie_domain: ; cookie_path: /; dbg: 3; debugs_output: ARRAY(0x9c267b8); destroy: 1; dir_config: Apache::Table=HASH(0x9a514b0); dirname: /usr/local/proj/mlink/site/asp/eg/; errors_output: ARRAY(0x9a502a8); 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(0x9a4d064); includes_dir: ARRAY(0x9a50344); init_packages: ARRAY(0x9a524e4); inode_names: ; lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x9c1d3ec); last_compile_include_data: HASH(0x9a516e4); last_time: 1284054672.3176; no_cache: ; package: Apache::ASP::Demo; paranoid_session: ; parse_config: 1; parse_file_count: 4; pod_comments: 1; r: Apache=SCALAR(0x9c24e04); register_includes: HASH(0x9c36b30); remote_ip: 38.107.191.87; request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x9c33f14); search_dirs_cache: HASH(0x9c1c7ac); secure_session: ; session_cookie: 1; session_count: 1; session_id: 0907acb90f7ceff9d9c36ecaedeae879; 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: 1284054672.2708; 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: ;
  72. errors out
  73. 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(0x9c334cc)', '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(0x9182488)', '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(0x9182488)') called at /usr/local/perl562/lib/site_perl/5.6.2/Apache/ASP.pm line 192 Apache::ASP::handler('Apache=SCALAR(0x9c24e04)') 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.