Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Boolean-values/Perl/boolean-values-1.pl
Normal file
2
Task/Boolean-values/Perl/boolean-values-1.pl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
my $x = 0.0;
|
||||
my $true_or_false = $x ? 'true' : 'false'; # false
|
||||
10
Task/Boolean-values/Perl/boolean-values-2.pl
Normal file
10
Task/Boolean-values/Perl/boolean-values-2.pl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
my $x = 1; # true
|
||||
|
||||
my $true_or_false;
|
||||
|
||||
if ($x) {
|
||||
$true_or_false = 'true';
|
||||
}
|
||||
else {
|
||||
$true_or_false = 'false';
|
||||
}
|
||||
5
Task/Boolean-values/Perl/boolean-values-3.pl
Normal file
5
Task/Boolean-values/Perl/boolean-values-3.pl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
print (7 && 2); # 2, rather than 1(true)
|
||||
print (2 && 7); # 7, rather than 1(true)
|
||||
print (7 xor 2); # empty string, rather than 0(false)
|
||||
print ('apples' && 'pears'); # pears, rather than 1(true)
|
||||
print ('apples' xor 'pears'); # empty string, rather than 0(false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue