my $x=4 if(1); #x is as good as global for this file. if(1) { my $x=5; # x is visible inside the block for compiler so it makes it inside. }