in reply to Using Perl on OS X
BBEdit saves files by default with Mac line endings and not Unix line endings. If that is how you saved the file, it won't run. There are two ways to change the line endings in BBEdit, one is under "Options" in the "Save/Save as" window, the other is under one of the little icons at the top of the text window.
Also, you can change the default behavior in the Saving section of the Preferences dialog.