Thread RegEx: Platzhalter ersetzen klappt nicht (32 answers)
Opened by Lightman at 2007-04-07 21:40

bloonix
 2007-04-08 20:38
#75738 #75738
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Hallo Lightman,

mit CPAN:Template geht das auch:

Code: (dl )
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
use strict;
use warnings;
use Template;

my %vars = (
  test => 'Hello World!',
  another_test => 'How are you?'
);

my $template = new Template;
$template->process(\*DATA, \%vars);

__END__
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Test template</title>
</head>
<body>
<h1>[% test %]</h1>
<h3>[% another_test %]</h3>
</body>
</html>


;)

Gruss,
opi
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread RegEx: Platzhalter ersetzen klappt nicht