programming-examples/perl/Subroutine/Nested subroutine with local variable.pl
2019-11-15 12:59:38 +01:00

13 lines
147 B
Perl

$value = 1;
sub printem() {
print "\$value = $value\n"
};
sub makelocal() {
my $value = 2;
printem;
}
makelocal;
printem;