First, I agree with moritz's suggestion. Second, you might want to try use strict; and use warnings; The only thing more amazing than how quickly the errors they generate can help me find and fix a problem is how often I forget to use them from the outset myself.