]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
perl snippets for sub and foreach.
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 4 Nov 2014 19:43:40 +0000 (20:43 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 4 Nov 2014 19:43:40 +0000 (20:43 +0100)
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
snippets/cperl-mode/fore [new file with mode: 0644]
snippets/cperl-mode/getopt
snippets/cperl-mode/sub [new file with mode: 0644]

diff --git a/snippets/cperl-mode/fore b/snippets/cperl-mode/fore
new file mode 100644 (file)
index 0000000..7060798
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: foreach ... { ... }
+# key: fore
+# --
+foreach my \$${1:x} (@${2:array}) {
+    ${3:# body...}
+}
\ No newline at end of file
index 8e032f32811063473d3c84c0b4e572820d8c76c6..ce9297c0c83ea893a6a2fe1ca0ca35acd29c9556 100644 (file)
@@ -1,4 +1,4 @@
-# -*- mode: snippets -*-
+# -*- mode: snippet -*-
 # name: getopt
 # key: getopt
 # --
diff --git a/snippets/cperl-mode/sub b/snippets/cperl-mode/sub
new file mode 100644 (file)
index 0000000..c41d5f8
--- /dev/null
@@ -0,0 +1,16 @@
+# -*- mode: snippet -*-
+# name: sub
+# key: sub
+# --
+
+=head2 ${1:function_name}
+
+$2
+
+=cut
+
+sub $1 {
+  $0
+
+
+}
\ No newline at end of file