#! /usr/bin/perl use strict; use warnings; use diagnostics; use CGI; use CGI::Carp qw(fatalsToBrowser); use HTML::Template; # musst Du Dir evtl. noch installieren my $cgi = CGI->new(); my %params = $cgi->Vars(); print $cgi->header(-type => 'text/html'); my $template = HTML::Template->new(filename => 'template.html'); if($params{add}){ # wenn artikel hinzugefĆ¼gt werden soll my @loop = (); if($params{alt}){ my @artikel = split(/;/,$params{alt}); foreach(@artikel){ my ($art_name,$stueck,$euro) = split(/#/,$_); push(@loop,{ARTIKEL => $art_name, STUECK => $stueck, EURO => $euro}); } } push(@loop,{ARTIKEL => $params{ARTIKEL}, STUECK => $params{STUECK}, EURO => $params{EURO}); my $alte = $params{alt}.";$params{ARTIKEL}#$params{STUECK}#$params{EURO}"; $template->param(ALT => $alte, ARTIKELLISTE => \@loop); } else{ # Mail versenden } print $template->output();