my $qry = ""; my $name = "Mueller"; my $plz = "55555"; if ($name) { $qry .= "::5544$nameGDFT"; } if ($plz) { $qry .= "xxxxx$plz::0:";} print $qry;