Block variable scope : Code Block « Language Basics « Perl
- Perl
- Language Basics
- Code Block
Block variable scope
#!/usr/bin/perl
use warnings;
use strict;
my $text = "This is the child";
{
my $text = "This is block scoped";
print "$text \n";
}
print "$text \n";
Related examples in the same category