programming-examples/perl/Subroutine/Using shift(@_) to get value passed into a subroutine.pl

13 lines
225 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$value = 10;
printifOK ($value);
sub printifOK
{
my $internalvalue = shift(@_);
if ($internalvalue > 10 ) {
print "Value is $value.\n";
} else {
print "Value is too small.\n";
}
}