Getting a Perl file to run under Ubuntu?

Yeah, so your perltest.pl one is due to bad script. You either have output or something happening before headers are written.

The echo.pl is a permission issue, meaning it didn’t have chomd a+x run against it.