programming-examples/perl/Subroutine/Define subroutine and call it with using global variable.pl
2019-11-15 12:59:38 +01:00

15 lines
200 B
Perl

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