programming-examples/perl/Subroutine/Nested subroutine with local variable.pl

13 lines
147 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$value = 1;
sub printem() {
print "\$value = $value\n"
};
sub makelocal() {
my $value = 2;
printem;
}
makelocal;
printem;