Horje
perl post condition Code Example
perl post condition
# Basic syntax:
statement if condition;
statement unless condition;

# Example usage:
my $x = 3;
my $y = 5;
# run the statement on the left only if the statement on the right is true
print "x is less than y\n" if $x < $y;
--> x is less than y

# run the statement on the left only if the statement on the right is false
print "x is less than y\n" unless $x > $y;
--> x is less than y




14

Related
perl input output Code Example perl input output Code Example
perl foreach loop Code Example perl foreach loop Code Example
perl print an array Code Example perl print an array Code Example
perl math operators Code Example perl math operators Code Example
perl add to hash Code Example perl add to hash Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11