#!/usr/bin/perl -w use strict; #<- very important. my $foo = 3; # $foo has a value of 3, and is seen by the compiler. { my $bar = 5; # $ bar life is limited to the block. print "$bar\n"; # you get 5. print "$foo\n"; # you get 3. } print "$bar\n"; # <- compiler gives error.$bar does not exsist (kind of). print "$foo\n"; # you get 3.