Perldoc: 'A my declares the listed variables to be local (lexically) to the enclosing block, file, or eval.'
So, by using 'my' you restrict the scope of a variable, meaning the part of your program (code) where the variable is valid. Declaring a variable without 'my' implicitly makes it globally valid. Also, by using 'use strict' perl demands 'my' declaration, which helps you to spot errors, e. g. in variable names, easier in your code.