Improve Perl detection

Specifically, this allows for detection of `#!/usr/bin/env perl` which is increasingly common. It also adds the standard Perl test extension .t