M
Mintcake
#!/usr/local/bin/perl
use strict;
use warnings;
for my $i (1..10)
{
my $i = 0; # Why no warning
}
use strict;
use warnings;
for my $i (1..10)
{
my $i = 0; # Why no warning
}
Mintcake said:#!/usr/local/bin/perl
use strict;
use warnings;
for my $i (1..10)
{
my $i = 0; # Why no warning
}
#!/usr/local/bin/perl
use strict;
use warnings;
for my $i (1..10)
{
my $i = 0; # Why no warning
Different scope.
John
Mintcake said:Why different scope? - both instances of $i exist only with the {}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.