Create Perl with template in Emacs

xiaoxiao2021-03-06  42

When writing Perl's program, you should always do the following things:

#! / usr / bin / env Perl # Where to find Perl, because it is possible to write on a different machine, so to write this way

Begin {

Unshift @inc, "/ you / perl / lib / path"; # I always have to put some modules, can only install it in your own directory when working

}

Use warnings; # 不用-只 只 老 老 老 写 写 句

Use strict; # for a few white hair when you debug, it is best to write him

Use Data :: Dumper :: Simple; # 同 上 东 东 西 写 写 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无 无Based on the purpose of Perl: lazy, impatient and arrogant, such a life is unbearable. The Emacswiki turned into a circle and found the following solution.

(Require 'AutoInsert) ;; This module is the Emacs that does not need himself

(Auto-INSERT-MODE) ;; Automatically opens this module, when starting EMACS (setq auto-insert-directory "~ / .mytemplates /") ;;; Define your own magic board directory

(setq auto-insert-query nil) ;;; Do not prompt when inserting

(Define-auto-insert "/.pl" "my-perl-template.pl") ;;; template file, write a new .pl Document trial in my-perl-template.pl in my-perl-teemplate.pl A try. LOOK, cool, the same can be used in any other program

转载请注明原文地址:https://www.9cbs.com/read-64400.html

New Post(0)