#!/usr/bin/perl
use strict;
use warnings;
my $val = 1;
#first
print "first (if)\n";
if($val > 1){
print "if > 1\n";
}else{
print "else <= 1\n";
}
not functional
#second
print "second (if)\n";
$val = 2;
if($val < 1){
print "if < 1\n";
}unless($val > 1){
print "unless < 1\n";
}
#third
print "third (if)\n";
$val = 'a';
if($val =~ 'a'){
print "if = a\n";
}unless($val =~ 'b'){
print "unless != a\n";
}
result
first (if)
else <= 1
second (if)
third (if)
if = a
unless != a
0 comentários:
Post a Comment