By adding either #!perl -w or use warnings 'all'; to the top of your program, you would receive diagnostic messages that would have helped you find the problem; i.e. Name "main::NUMBER" used only once: possible typo at line 47 Name "main::DISK" used only once: possible typo at line 31