I recommend the editor
gvim - it's free and has very good context-highlighting for perl (and just about everything else).
Create a text file called something.pl, and put your code in it. If you edit in one window and run with a command line 'perl something.pl' in another window, it should be fine. There's no compilation step with perl, so you don't have to worry about that one.