in reply to beginner's question

Besides the issue with use strict and use warnings pointed out above, it seems that your problem arises from using TextMate's Perl bundle.

Check out http://lists.macromates.com/textmate/2010-August/031406.html.