Thread HTML::Template: SID an -fast- jeden Link anhängen (4 answers)
Opened by bloonix at 2006-01-05 11:42

esskar
 2006-01-05 15:23
#6440 #6440
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sub gen_param_list {
  my ($name, $value, $start) = @_;
  $start ||= "";

  return $start unless $name && $value;

  my $retVal = $start;
  if($retVal ne '') {
     $retVal .= ';' unless $retVal =~m{;$}; # mir gefallen "&"'s nicht
  }

  $retVal .= "$name=$value";

  return $retVal;
}


PS: man müsste $name & $value noch uri-encodieren um sicher zu bleiben

aufruf

Code: (dl )
1
2
3
4
5
6
my $param = gen_param_list("foo", "bar");
$param = gen_param_list("sid", $sid, $param);

# usw

$template->param(ARGV => $param);
\n\n

<!--EDIT|esskar|1136467469-->

View full thread HTML::Template: SID an -fast- jeden Link anhängen