change default of using system perl to env perl if executable; minor code clean up