Help for this page

Select Code to Download


  1. or download this
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(t
    +ime);
    $date = "$mday/$mon/$year $hour:$min:$sec"; # THIS IS WRONG!!!!
    ...
    # do something like this instead:
    my @time = localtime;
    my $date = sprintf("%2d/%2d/%4d %02d:%02d:%02d", $time[4] + 1, $time[3
    +], $time[5] + 1900, @time[2,1,0]);
    
  2. or download this
    while(my ($key, $value) = each(%forward)) {
        if ($to =~ $key) {
    ...
            $forward_address = $value;
        }
    }
    
  3. or download this
    if( exists $forward{$to} ){
            $local_address = $key;
            $forward_address = $value;
    }
    
  4. or download this
        $sql = <<EOF;
    SELECT "tblForwardMail"."ForwardMailID", "tblFilterMail"."FilterMailEm
    +ail"
    ...
    # But it seems like what you want next is just:
    (undef,$filter_address) = $dbh->selectrow_array($dbh,{},$local_address
    +);
    # make sure to pre-declare $filter_address
    
  5. or download this
    foreach my $email_address(@filter) {
        if (($from =~ $email_address)){
            $store = "YES";
        }
    }
    
  6. or download this
    $store = "YES" if grep( $_ eq $from, @filter );
    
  7. or download this
    $store = "YES" if $from eq $filter_address;
    
  8. or download this
      $store = 1;  # true
      $store = 0;  # false
    ...
      if( ! $store ){
        ...
      }
    
  9. or download this
    #Declare variables to be used including command line variables if need
    +ed
    my ($stored_email, $log, $to, $from, $forward_address, $store, $body, 
    +$sql, $sth, $date, $local_address);