Skip to content

Commit 9ebc5be

Browse files
committed
DBI existence check
1 parent 795c4ef commit 9ebc5be

File tree

4 files changed

+53
-36
lines changed

4 files changed

+53
-36
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
archive/
22
qt/
33
logs/
4+
perl/bin
5+
perl/lib
46
tmp/
5-
perl/bin/perl
67

78
*.qm
89
*.autosave

resources/app/perl/interactive-script.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if (eval("require AnyEvent;")) {
99
AnyEvent->import();
1010
} else {
11-
print "AnyEvent Perl module is not loaded.<br><br>";
11+
print "AnyEvent module is missing in this Perl distribution.<br><br>";
1212
exit 0;
1313
}
1414

resources/app/perl/sqlite.pl

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,55 @@
77
use utf8;
88
use open ':std', ':encoding(UTF-8)';
99
use Cwd;
10-
use DBI;
11-
12-
print "
13-
<!DOCTYPE html>
14-
<html>
15-
16-
<head>
17-
<title>Perl Executing Browser - SQLite Test</title>
18-
<meta name='viewport' content='width=device-width, initial-scale=1'>
19-
<meta charset='utf-8'>
20-
<link rel='stylesheet' type='text/css' href='http://local-pseudodomain/bootstrap/css/themes/darkly-theme.css' media='all'>
21-
<style type='text/css'>
22-
body {
23-
text-align: center;
24-
font-size: 22px;
25-
-webkit-text-size-adjust: 100%;
26-
}
27-
pre {
28-
text-align: left;
29-
font-size: 14px;
30-
font-family: monospace;
31-
}
32-
</style>
33-
</head>
34-
35-
<body>
36-
<p>
37-
SQLite Test
38-
</p>
39-
<pre>";
10+
11+
sub html_header() {
12+
print "
13+
<!DOCTYPE html>
14+
<html>
15+
16+
<head>
17+
<title>Perl Executing Browser - SQLite Test</title>
18+
<meta name='viewport' content='width=device-width, initial-scale=1'>
19+
<meta charset='utf-8'>
20+
<link rel='stylesheet' type='text/css' href='http://local-pseudodomain/bootstrap/css/themes/darkly-theme.css' media='all'>
21+
<style type='text/css'>
22+
body {
23+
text-align: center;
24+
font-size: 22px;
25+
-webkit-text-size-adjust: 100%;
26+
}
27+
pre {
28+
text-align: left;
29+
font-size: 14px;
30+
font-family: monospace;
31+
}
32+
</style>
33+
</head>
34+
35+
<body>
36+
<p>
37+
SQLite Test
38+
</p>
39+
<pre>";
40+
}
41+
42+
sub html_footer() {
43+
print "</pre>
44+
</body>
45+
46+
</html>\n";
47+
}
48+
49+
if (eval("require DBI;")) {
50+
DBI->import();
51+
} else {
52+
html_header();
53+
print "DBI module is missing in this Perl distribution.";
54+
html_footer();
55+
exit 0;
56+
}
57+
58+
html_header();
4059

4160
my $cwd = cwd();
4261
my $database_relative_pathname = "/resources/data/test.db";
@@ -63,7 +82,4 @@
6382

6483
$db->disconnect;
6584

66-
print "</pre>
67-
</body>
68-
69-
</html>\n";
85+
html_footer();

screenshots/peb-perl-debugger.png

-104 KB
Binary file not shown.

0 commit comments

Comments
 (0)