File: syntax_error.asp

package info (click to toggle)
libapache-asp-perl 2.63-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,120 kB
  • sloc: perl: 6,044; php: 409; sh: 62; lisp: 22; makefile: 10
file content (76 lines) | stat: -rwxr-xr-x 1,539 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/perl /usr/bin/asp-perl

<% 
use File::Basename;
if($Request->QueryString('buffer')) {
	$Response->{Buffer} = 1;
} else {
	$Response->{Buffer} = 0; 
}
%>
<!--#include file=header.inc-->
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.
<p>
You can turn this error messaging off by setting the Debug variable
in the ASP config to 1 or 0.
<p>
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.
<p>
=pod
This pod comment will be yanked upon compilation
=cut
<% 
   $Response->Debug(
	"Debugging", 
	['can', 'take'], 
	{'just'=>'about'},
	sub { ['any', 'kind']},
	\"of reference",
	"or scalar"
	);

   print "Try this script also with <a href=".basename($0)."?buffer=1>buffering on.</a>";
%>

<p>

This script by default does a runtime syntax error.  If you would like
to see a script <b>compile error, <a href="<%= basename($0) %>?compile_error=1">click here</a></b>.

<p>
<a href="source.asp?file=<%=$Request->ServerVariables("SCRIPT_NAME")%>">
view this file's source
</a>

<br>
<br>

<% 
if($Request->QueryString('compile_error')) {
  $Response->Include("compile_error.inc");
} else {
        my $Object;
	# create a run-time syntax error
	$Object->SyntaxError(); 
}
%>












Misc Text Below Error