From 7292342afd74b9cc812a727b12ce42626c7886ef Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 23 Jan 2020 22:03:07 +0900 Subject: Add some snippets for Perl --- template/perl/snip-method.pl | 6 ++++++ template/perl/snip-new.pl | 5 +++++ template/perl/snip-sub.pl | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 template/perl/snip-method.pl create mode 100644 template/perl/snip-new.pl 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_}} } -- cgit v1.2.3-54-g00ecf