Either do what
blackjudas showed above, or:
- Initialize your variables, which doesn't look reasonable.
- no warnings qw(uninitialized); #(what I would do)
perldoc perllexwarn for more information on #2. I would suppress warnings in just that block, so the rest of your code won't be affected.