my $x = "this is a value before the block";
for (my $x=0;$x<10;$x++) { #note the new block
    print "$x "; #this is the $x that is local to this block 
        # and declared in the for
}
print "and now x is $x again\n"; #block was closed so the original 
    # $x is visible again
