aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-23 22:03:07 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-23 22:03:07 +0900
commit7292342afd74b9cc812a727b12ce42626c7886ef (patch)
treec509686bfa091561aae8bd9125f7186660cd6dac
parentfbb650c33bd1dd791cc2e79b5b034301b7abbbe3 (diff)
downloadvim-sonictemplate-7292342afd74b9cc812a727b12ce42626c7886ef.tar.gz
vim-sonictemplate-7292342afd74b9cc812a727b12ce42626c7886ef.tar.bz2
vim-sonictemplate-7292342afd74b9cc812a727b12ce42626c7886ef.zip
Add some snippets for Perl
-rw-r--r--template/perl/snip-method.pl6
-rw-r--r--template/perl/snip-new.pl5
-rw-r--r--template/perl/snip-sub.pl2
3 files changed, 12 insertions, 1 deletions
diff --git a/template/perl/snip-method.pl b/template/perl/snip-method.pl
new file mode 100644
index 0000000..e51e2d8
--- /dev/null
+++ b/template/perl/snip-method.pl
@@ -0,0 +1,6 @@
+sub {{_input_:function name}} {
+ my $self = shift;
+ my @args = @_;
+ {{_cursor_}}
+}
+
diff --git a/template/perl/snip-new.pl b/template/perl/snip-new.pl
new file mode 100644
index 0000000..1f987d8
--- /dev/null
+++ b/template/perl/snip-new.pl
@@ -0,0 +1,5 @@
+sub new {
+ my $class = shift;
+ return bless { @_ } , ref $class || $class;
+}
+
diff --git a/template/perl/snip-sub.pl b/template/perl/snip-sub.pl
index 32f0e6d..3d63276 100644
--- a/template/perl/snip-sub.pl
+++ b/template/perl/snip-sub.pl
@@ -1,5 +1,5 @@
sub {{_input_:function name}} {
- my ($self{{_input_:arguments}}) = @_;
+ my @args = @_;
{{_cursor_}}
}