Thread HTML Formulare und Perl (23 answers)
Opened by kruemmel at 2007-07-24 20:47

pq
 2007-07-25 14:14
#78799 #78799
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
[quote=renee,25.07.2007, 09:59]@bieber: Dein Code mal mit CPAN:HTML::Template::Compiled:
[...][/quote]
oder gleich mit dem HTML_Tags plugin:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use warnings;
use HTML::Template::Compiled;
my $htc = HTML::Template::Compiled->new(
    filehandle => \*DATA,
    plugin => [qw(::HTML_Tags)],
);

my $jahr = 2027;

my @values = map { [ $_, $_ ] } 2007 .. 2059;
$htc->param( years => [ $jahr, @values] );
print $htc->output;

__DATA__
<form method="post" action="index.pl ">
<select name="JAHR">
<%html_option years %>
</select>
</form>
\n\n

<!--EDIT|pq|1185358515-->
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread HTML Formulare und Perl