sub send_to_blat { # Benötigte Variablen lokal zur Verfügung stellen               ;            #       local($print_config,$key,$sort_order,$sorted_field,$env_report); # Email Subject bestimmen    $betreff = '';       if ($Config{'subject'}) { $betreff = $Config{'subject'} }       else                     { $betreff = WWW Form Submission } # Adresse bestimmen   $address = $Config{'recipient'}; # Messageinhalt bestimmen   # Variable initialisieren, hier soll der komplette Textkörper hineingeschrieben werden   $message = 'Anbei die Resultate der Befragung. Sie wurden abgeschickt durch: ' . '$Config{'realname'} ($Config{'email'}) on $date ';   # Prüft die Option print_config und handelt entsprechend   if (@Print_Config) {      foreach $print_config (@Print_Config) {           if ($Config{$print_config}) {           $message .= '$print_config: $Config{$print_config} ';        }      }   }   # Alphabetisch sortieren, falls verlangt             &nbs p;               #      if ($Config{'sort'} eq 'alphabetic') {            foreach $field (sort keys %Form) {             # If the field has a value or the print blank fields option      #             # is turned on, print out the form field and value.               #             if ($Config{'print_blank_fields'} || $Form{$field} ||                  $Form{$field} eq '0') {                  $message .= '$field: $Form{$field} ';             }          }      }      # Felder nach angegebener Reihenfolge sortieren, falls verlangt      #   elsif ($Config{'sort'} =~ /^order:.*,.*/) {            # Remove extraneous line breaks and spaces, remove the order:  #      # directive and split the sort fields into an array.           #            $Config{'sort'} =~ s/(\s+| )?,(\s+| )?/,/g;            $Config{'sort'} =~ s/(\s+)? +(\s+)?//g;            $Config{'sort'} =~ s/order://;            @sorted_fields = split(/,/, $Config{'sort'});            # For each sorted field, if it has a value or the print blank  #            # fields option is turned on print the form field and value.   #            foreach $sorted_field (@sorted_fields) {                    if ($Config{'print_blank_fields'} || $Form{$sorted_field} || $Form{$sorted_field} eq '0') {                     $message .= '$sorted_field: $Form{$sorted_field} ';                  }            }        }        # Ansonsten in der angegeben Reihenfolge verschicken      #        else {         # For each form field, if it has a value or the print blank          #         # fields option is turned on print the form field and value.         #         foreach $field (@Field_Order) {             if ($Config{'print_blank_fields'} || $Form{$field} || $Form{$field} eq '0') {                  $message .= '$field: $Form{$field} ';             }         }     }     # System Umgebungsvariablen mit in die Nachricht einpacken             &nb sp;   #       foreach $env_report (@Env_Report) {         if ($ENV{$env_report}) {             $message .= '$env_report: $ENV{$env_report} ';         }       } # Zusammenstellen der Kommandozeile für späteren Systemaufruf    $commandline = $mailprog;    $commandline .= $message;    $commandline .= "-s \"$betreff\" " if $betreff;    $commandline .= "-t \"$recipients\" " if $recipients;    # $commandline .= "-f $config{'email'} " if $config{'email'};     # Senden der Email    system($commandline);