Leser: 1
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
58 Einträge, 6 Seiten |
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
#!D:\xampp\perl\bin\perl.exe
use strict;
use warnings;
use HTML::Template;
print "Content-type: text/html\n\n";
# Hier wird das Template geoeffnet
my $template = HTML::Template->new(filename => 'irland.tmpl');
# Hier soll jeweils eine Datei mit dem Text geöffnet werden
open(TEXTDATEI, "text.txt");
my $text = <TEXTDATEI>;
close(TEXTDATEI);
$template->param(TEXT => $text);
# Gleichbleibende Bildpfade fuer Header und Navigation
my $header = '/images/header.jpg';
my $navi = '/images/navi.gif';
$template->param(HEADER => $header);
$template->param(NAVI => $navi);
# Eine Datei mit den Linkpfaden
my $link1 = '/irland.cgi';
$template->param(LINK1 => $link1);
# Eine Datei mit den Bildpfaden
my $bild = '/images/menschen.gif';
my $titel = '/images/titel_menschen.gif';
$template->param(BILD => $bild);
$template->param(TITEL => $titel);
print $template->output();
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
<html>
<head>
<title>Irland</title>
</head>
<body>
<div align="center"><br>
<br>
<table width="650" border="0">
<tr>
<td colspan="2"><div align="center"><img src="<!-- TMPL_VAR NAME=HEADER -->" alt="Header" width="650" height="168" /></div>
<div align="center"></div></td>
</tr>
<tr>
<td colspan="2"><div align="center"><img src="<!-- TMPL_VAR NAME=NAVI -->" alt="Navigation" width="650" height="23" border="0" usemap="#Map" /></div>
<div align="center"></div></td>
</tr>
<tr>
<td height="23"><div align="center"></div></td>
<td width="386"><div align="center">
</div></td>
</tr>
<tr>
<td width="260"><div align="center"><img src="<!-- TMPL_VAR NAME=BILD -->" alt="Land" width="250" height="298" align="left" /></div></td>
<td rowspan="2">
<!-- TMPL_VAR NAME=TEXT -->
</td>
</tr>
<tr>
<td><div align="center"><img src="<!-- TMPL_VAR NAME=TITEL -->" alt="Titel" width="250" height="69" align="left" /></div></td>
</tr>
<tr>
<td><div align="center"></div></td>
<td><div align="center"></div></td>
</tr>
</table>
</div>
<map name="Map" id="Map"><br>
<area shape="rect" coords="26,3,93,20" href="<!-- TMPL_VAR NAME=LINK1 -->" target="_self" alt="Home" />
<area shape="rect" coords="124,3,185,20" href="land.html" target="_self" alt="Land" />
<area shape="rect" coords="218,3,350,20" href="geschichte.html" target="_self" alt="Geschichte" />
<area shape="rect" coords="382,3,504,20" href="menschen.html" target="_self" alt="Menschen" />
<area shape="rect" coords="536,3,622,20" href="politik.html" target="_self" alt="Politik" />
</map>
</body>
</html>
my $text = join '', <TEXTDATEI>;
1
2
3
4
5
6
7
8
$id = "geschichte";
$id2 = "geschichte";
if ($id eq $id2)
{
my $textname = "text";
}
open(TEXTDATEI, "$textname.txt");
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
#!D:\xampp\perl\bin\perl.exe
use strict;
use warnings;
use HTML::Template;
use CGI::Carp qw(fatalsToBrowser);# Zeigt Dir Fehler an
$SIG{_ _ W A R N _ _} = sub {die 'WARN: '.shift}; # Sorgt dafür, daß Warnungen auch als Fehler im Browser angezeigt werden. Ich hab's nur gesperrt geschrieben, damit es hier nicht unterdrückt wird.
print "Content-type: text/html\n\n";
# Hier wird das Template geoeffnet
my $template = HTML::Template->new(filename => 'irland.tmpl');
# Hier soll jeweils eine Datei mit dem Text geöffnet werden
open(TEXTDATEI, "text.txt") or die "Can't open text.txt: $!";
my $text = <TEXTDATEI>;
close(TEXTDATEI);
$template->param(TEXT => $text); # use Encode::Entities; und encode_entities $text, denn $text kann HTML enthalten.
# Gleichbleibende Bildpfade fuer Header und Navigation
my $header = '/images/header.jpg';
my $navi = '/images/navi.gif';
$template->param(HEADER => $header);
$template->param(NAVI => $navi);
# Eine Datei mit den Linkpfaden
my $link1 = '/irland.cgi';
$template->param(LINK1 => $link1);
# Eine Datei mit den Bildpfaden
my $bild = '/images/menschen.gif';
my $titel = '/images/titel_menschen.gif';
$template->param(BILD => $bild);
$template->param(TITEL => $titel);
print $template->output();
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
58 Einträge, 6 Seiten |