Your problem is that since you are using "use strict;" perl demands that all your variables has to be declared. Which is done by using the keyword "my" and the variable name eg. these are legal:
my $varible;
my $variable = 0;
my $variable = "hello";

But if I just use a variable for the first time without having the my word in it:
$variable = 2;

Perl will tell you the exact errors that you got.

One main reason to use "use strict;" is to catch spelling errors in variable names.
eg.
my $hello = "hello\n";
print $helo;

Will for instance output an empty string and a warning since the variable $helo is undefined.