neosnippet.vim/autoload/neocomplcache/sources/snippets_complete/perl.snip

77 lines
964 B
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet perl
#!/opt/local/bin/perl
use strict;
use warnings;
${1}
snippet sub
sub ${1:function_name} {
${2:# body...}
}
snippet if
if (${1}) {
${2:# body...}
}
snippet ife
if (${1}) {
${2:# body...}
} else {
${3:# else...}
}
snippet ifee
if (${1}) {
${2:# body...}
} elsif (${3}) {
${4:# elsif...}
} else {
${5:# else...}
}
snippet xif
${1:expression} if ${2:condition};
snippet while
abbr wh
while (${1}) {
${2:# body...}
}
snippet xwhile
abbr xwh
${1:expression} while ${2:condition};
snippet for
for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
${3:# body...}
}
snippet fore
for ${1} (${2:expression}){
${3:# body...}
}
snippet xfor
${1:expression} for @${2:array};
snippet unless
abbr un
unless (${1}) {
${2:# body...}
}
snippet xunless
abbr xun
${1:expression} unless ${2:condition};
snippet eval
eval {
${1:# do something risky...}
};
if ($@) {
${2:# handle failure...}
}