Skip to content

Instantly share code, notes, and snippets.

@wfwei
Created December 2, 2016 08:55
Show Gist options
  • Save wfwei/269404311541d33a32900a1b678fce13 to your computer and use it in GitHub Desktop.
Save wfwei/269404311541d33a32900a1b678fce13 to your computer and use it in GitHub Desktop.
in range function in perl
#
# 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