You can just M-x `perl-mode` to activate perl mode. Or, set a easy key to perl-mode. For example, (global-set-key (kbd "<f8>") 'perl-mode) Or, you can put add this comment to the first line in the bash file # -*- mode: perl -*- then, it'll open with perl mode. Or, you can put the following at the bottom # Local Variables: # eval: (perl-mode 1) # End: Does that answer your question?