Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Integer-comparison/Perl/integer-comparison-1.pl
Normal file
13
Task/Integer-comparison/Perl/integer-comparison-1.pl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
sub test_num {
|
||||
my $f = shift;
|
||||
my $s = shift;
|
||||
if ($f < $s){
|
||||
return -1; # returns -1 if $f is less than $s
|
||||
} elsif ($f > $s) {
|
||||
return 1; # returns 1 if $f is greater than $s
|
||||
} elsif ($f == $s) {
|
||||
# = operator is an assignment
|
||||
# == operator is a numeric comparison
|
||||
return 0; # returns 0 $f is equal to $s
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue