programming-examples/perl/Subroutine/Using shift(@_) to get value passed into a subroutine.pl
2019-11-15 12:59:38 +01:00

13 lines
225 B
Perl

$value = 10;
printifOK ($value);
sub printifOK
{
my $internalvalue = shift(@_);
if ($internalvalue > 10 ) {
print "Value is $value.\n";
} else {
print "Value is too small.\n";
}
}