Changes

From SME Server
Jump to navigationJump to search
Line 697: Line 697:  
A few samples that demonstrate correct coding practise. In areas of logic, Testing user input, and calling events and unix programs.
 
A few samples that demonstrate correct coding practise. In areas of logic, Testing user input, and calling events and unix programs.
 
====Logic====
 
====Logic====
"||" gives an answer if the first try didn't work.
+
* "||" gives an answer if the first try didn't work.
    
       my $FetchmailFreqOffice = db_get_prop(\%conf, "fetchmail", "FreqOffice")
 
       my $FetchmailFreqOffice = db_get_prop(\%conf, "fetchmail", "FreqOffice")
Line 709: Line 709:  
     'standard';
 
     'standard';
   −
"if (defined $something)" if defined then first else second
+
* "if (defined $something)" if defined then first else second
    
     my $SecondaryMailUseEnvelope;
 
     my $SecondaryMailUseEnvelope;
Line 722: Line 722:  
     }
 
     }
   −
"&&" if true twice continue
+
* "&&" if true twice continue
    
     if (defined $backup_status && $backup_status eq "enabled")
 
     if (defined $backup_status && $backup_status eq "enabled")

Navigation menu