Created
December 2, 2016 08:55
-
-
Save wfwei/269404311541d33a32900a1b678fce13 to your computer and use it in GitHub Desktop.
in range function in perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Hello World Program in Perl | |
# | |
print "\nHello World!\n"; | |
sub inRange | |
{ | |
(my $var,my @rng)=@_; | |
my $res = "true"; | |
if ($rng[0]>=0 && $var<=$rng[0]) { | |
$res = "false"; | |
} | |
if ($rng[1]>=0 && $var>=$rng[1]) { | |
$res = "false"; | |
} | |
return $res; | |
} | |
my $var = 10; | |
my @rng = (1,20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment