programming-examples/perl/Subroutine/Using local.pl
2019-11-15 12:59:38 +01:00

16 lines
238 B
Perl

sub printifOK
{
local $localvalue = $value;
if ($localvalue > 10 ) {
print "Value is $value.\n";
} else {
print "Value is too small.\n";
}
}
$value = 10;
printifOK;
$value = 12;
printifOK;