From f5b8c378e729f4d8682a684ab320366a951164ad Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 08:09:49 +1200 Subject: [PATCH 01/20] use parent instead of base --- snippets/perl.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 4ba985d..0037cc3 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,7 +82,7 @@ snippet fore snippet cl package ${1:ClassName}; - use base qw(${2:ParentClass}); + use parent qw(${2:ParentClass}); sub new { my $class = shift; From fab29b6279ac835fe08fee4ade15bc4a8fc82fc6 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 18:21:55 +1200 Subject: [PATCH 02/20] experimenting with a couple new package constructs --- snippets/perl.snippets | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 0037cc3..d77d748 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,16 +82,30 @@ snippet fore snippet cl package ${1:ClassName}; - use parent qw(${2:ParentClass}); + #use parent qw(${2:ParentClass}); - sub new { - my $class = shift; - $class = ref $class if ref $class; - my $self = bless {}, $class; - $self; - } 1;${3} + + __END__ + +# Package block syntax +snippet package + package ${1:ClassName} ${2:version} { + + ${3:#}use Moose; + + ${4:#}use parent qw(${5:ParentClass}); + ${3:#}extends qw(${5:ParentClass}); + + ${6:#...} + + } + + 1; + + __END__ + # Read File snippet slurp my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; From 75598b4fee28a149d92f4a809a3911ececd3b441 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 20:32:53 +1200 Subject: [PATCH 03/20] experimenting with some new perl features --- snippets/perl.snippets | 86 ++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index d77d748..2796658 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -83,29 +83,51 @@ snippet cl package ${1:ClassName}; #use parent qw(${2:ParentClass}); - - - 1;${3} - - __END__ - -# Package block syntax -snippet package - package ${1:ClassName} ${2:version} { - - ${3:#}use Moose; - - ${4:#}use parent qw(${5:ParentClass}); - ${3:#}extends qw(${5:ParentClass}); - - ${6:#...} - - } + + ${3:#...} 1; __END__ +# Moose package +snippet moosecl + package ${1:ClassName}; + + use Moose; + #extends '${2:# ParentClass}'; + + ${3:#...} + + 1; + + + __END__ + + +# Package syntax perl >= 5.12.0 +snippet package + package ${1:ClassName} ${2:0.99}; + + ${3:#...} + + 1; + + __END__ + + +#moose +snippet moose + use Moose; + +# moose extends +snippet extends + extends qw(${1:Parent Class}); + +# parent +snippet parent + use parent qw(${1:Parent Class}); + # Read File snippet slurp my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; @@ -190,7 +212,6 @@ snippet hslice @{ ${1:hash} }{ ${2:array} } - # map snippet map map { ${2: body } } ${1: @array } ; @@ -276,33 +297,6 @@ snippet parg -# Moose package -snippet moosecl - package ${1:ClassName}; - - use Moose; - #extends '${2:# ParentClass}'; - - ${6:# body of class} - - 1; - - - __END__ - - =head1 NAME - - $1 - ${3:ShortDesc} - - =head1 SYNOPSIS - - ${4:# synopsis...} - - =head1 DESCRIPTION - - ${5:# longer description...} - - # Moose has snippet has has ${1:attribute} => ( From a5362402b819b01793ae7cbc5f5f1a467657f313 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 22:05:44 +1200 Subject: [PATCH 04/20] make package definitions more generic --- snippets/perl.snippets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 2796658..8164130 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,9 +82,7 @@ snippet fore snippet cl package ${1:ClassName}; - #use parent qw(${2:ParentClass}); - - ${3:#...} + ${2:#...} 1; @@ -93,7 +91,7 @@ snippet cl # Moose package snippet moosecl package ${1:ClassName}; - + use Moose; #extends '${2:# ParentClass}'; From dac0f8a7a68fc68e622acc965722e564a6bfc515 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:27:09 +1200 Subject: [PATCH 05/20] changing package template and a few others --- snippets/perl.snippets | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 8164130..ef30667 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -79,7 +79,7 @@ snippet for snippet fore ${1:expression} foreach @${2:array};${3} # Package -snippet cl +snippet package package ${1:ClassName}; ${2:#...} @@ -88,23 +88,9 @@ snippet cl __END__ -# Moose package -snippet moosecl - package ${1:ClassName}; - - use Moose; - #extends '${2:# ParentClass}'; - - ${3:#...} - - 1; - - - __END__ - # Package syntax perl >= 5.12.0 -snippet package +snippet packagev512 package ${1:ClassName} ${2:0.99}; ${3:#...} @@ -117,6 +103,8 @@ snippet package #moose snippet moose use Moose; + use namespace::autoclean; + #extends '${2:# ParentClass}'; # moose extends snippet extends @@ -298,10 +286,12 @@ snippet parg # Moose has snippet has has ${1:attribute} => ( - is => '${2:ro|rw}', + is => '${2:ro|rw}', isa => '${3:Str|Int|HashRef|ArrayRef|etc}', - default => ${4:defaultvalue} - ,${5:# other attributes} + default => sub { + ${4:defaultvalue} + }, + ${5:# other attributes} ); @@ -309,14 +299,14 @@ snippet has snippet override override ${1:attribute} => sub { ${2:# my $self = shift;}; - ${3:# my ($self,$args) = @_;}; + ${3:# my ($self, $args) = @_;}; }; # use test classes snippet tuse use Test::More; - use Test::Deep (); + use Test::Deep; # (); # uncomment to stop prototype errors use Test::Exception; # local test lib @@ -353,6 +343,7 @@ snippet tprep my $self = shift; ${4:# body} } + # cause failures to print stack trace snippet debug_trace use Carp; # 'verbose'; From cdacf7c3df67163b4bf9ce8ca863af84c1d72ee9 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:37:23 +1200 Subject: [PATCH 06/20] experimenting with file name in package snippet --- snippets/perl.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index ef30667..9afdee6 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -91,7 +91,7 @@ snippet package # Package syntax perl >= 5.12.0 snippet packagev512 - package ${1:ClassName} ${2:0.99}; + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; ${3:#...} @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - #extends '${2:# ParentClass}'; + ${1:#}extends '${2:# ParentClass}'; # moose extends snippet extends From f46672c1cf2e71f570ee6fec770a211b8e451daa Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:43:24 +1200 Subject: [PATCH 07/20] substitute regular package name --- snippets/perl.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 9afdee6..79462fc 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -80,7 +80,7 @@ snippet fore ${1:expression} foreach @${2:array};${3} # Package snippet package - package ${1:ClassName}; + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}; ${2:#...} @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - ${1:#}extends '${2:# ParentClass}'; + ${1:#}extends '${2:ParentClass}'; # moose extends snippet extends From c59a7f2c49bcf0b7eb91498cb4184b09818a9149 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 08:09:49 +1200 Subject: [PATCH 08/20] use parent instead of base --- snippets/perl.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 4ba985d..0037cc3 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,7 +82,7 @@ snippet fore snippet cl package ${1:ClassName}; - use base qw(${2:ParentClass}); + use parent qw(${2:ParentClass}); sub new { my $class = shift; From 79b4377ee3caf2060b4ffdcc3ccf39fbcdde5ded Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 18:21:55 +1200 Subject: [PATCH 09/20] experimenting with a couple new package constructs --- snippets/perl.snippets | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 0037cc3..d77d748 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,16 +82,30 @@ snippet fore snippet cl package ${1:ClassName}; - use parent qw(${2:ParentClass}); + #use parent qw(${2:ParentClass}); - sub new { - my $class = shift; - $class = ref $class if ref $class; - my $self = bless {}, $class; - $self; - } 1;${3} + + __END__ + +# Package block syntax +snippet package + package ${1:ClassName} ${2:version} { + + ${3:#}use Moose; + + ${4:#}use parent qw(${5:ParentClass}); + ${3:#}extends qw(${5:ParentClass}); + + ${6:#...} + + } + + 1; + + __END__ + # Read File snippet slurp my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; From b272f87f1f05ed81e57fc4356507a38892b5f8b8 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 20:32:53 +1200 Subject: [PATCH 10/20] experimenting with some new perl features --- snippets/perl.snippets | 86 ++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index d77d748..2796658 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -83,29 +83,51 @@ snippet cl package ${1:ClassName}; #use parent qw(${2:ParentClass}); - - - 1;${3} - - __END__ - -# Package block syntax -snippet package - package ${1:ClassName} ${2:version} { - - ${3:#}use Moose; - - ${4:#}use parent qw(${5:ParentClass}); - ${3:#}extends qw(${5:ParentClass}); - - ${6:#...} - - } + + ${3:#...} 1; __END__ +# Moose package +snippet moosecl + package ${1:ClassName}; + + use Moose; + #extends '${2:# ParentClass}'; + + ${3:#...} + + 1; + + + __END__ + + +# Package syntax perl >= 5.12.0 +snippet package + package ${1:ClassName} ${2:0.99}; + + ${3:#...} + + 1; + + __END__ + + +#moose +snippet moose + use Moose; + +# moose extends +snippet extends + extends qw(${1:Parent Class}); + +# parent +snippet parent + use parent qw(${1:Parent Class}); + # Read File snippet slurp my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; @@ -190,7 +212,6 @@ snippet hslice @{ ${1:hash} }{ ${2:array} } - # map snippet map map { ${2: body } } ${1: @array } ; @@ -276,33 +297,6 @@ snippet parg -# Moose package -snippet moosecl - package ${1:ClassName}; - - use Moose; - #extends '${2:# ParentClass}'; - - ${6:# body of class} - - 1; - - - __END__ - - =head1 NAME - - $1 - ${3:ShortDesc} - - =head1 SYNOPSIS - - ${4:# synopsis...} - - =head1 DESCRIPTION - - ${5:# longer description...} - - # Moose has snippet has has ${1:attribute} => ( From 313ec98d836305ae913344a4ba71a8926e3440f3 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 16 May 2012 22:05:44 +1200 Subject: [PATCH 11/20] make package definitions more generic --- snippets/perl.snippets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 2796658..8164130 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,9 +82,7 @@ snippet fore snippet cl package ${1:ClassName}; - #use parent qw(${2:ParentClass}); - - ${3:#...} + ${2:#...} 1; @@ -93,7 +91,7 @@ snippet cl # Moose package snippet moosecl package ${1:ClassName}; - + use Moose; #extends '${2:# ParentClass}'; From af4851445519c4ee7df3c1f31f1d000e22e0ef88 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:27:09 +1200 Subject: [PATCH 12/20] changing package template and a few others --- snippets/perl.snippets | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 8164130..ef30667 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -79,7 +79,7 @@ snippet for snippet fore ${1:expression} foreach @${2:array};${3} # Package -snippet cl +snippet package package ${1:ClassName}; ${2:#...} @@ -88,23 +88,9 @@ snippet cl __END__ -# Moose package -snippet moosecl - package ${1:ClassName}; - - use Moose; - #extends '${2:# ParentClass}'; - - ${3:#...} - - 1; - - - __END__ - # Package syntax perl >= 5.12.0 -snippet package +snippet packagev512 package ${1:ClassName} ${2:0.99}; ${3:#...} @@ -117,6 +103,8 @@ snippet package #moose snippet moose use Moose; + use namespace::autoclean; + #extends '${2:# ParentClass}'; # moose extends snippet extends @@ -298,10 +286,12 @@ snippet parg # Moose has snippet has has ${1:attribute} => ( - is => '${2:ro|rw}', + is => '${2:ro|rw}', isa => '${3:Str|Int|HashRef|ArrayRef|etc}', - default => ${4:defaultvalue} - ,${5:# other attributes} + default => sub { + ${4:defaultvalue} + }, + ${5:# other attributes} ); @@ -309,14 +299,14 @@ snippet has snippet override override ${1:attribute} => sub { ${2:# my $self = shift;}; - ${3:# my ($self,$args) = @_;}; + ${3:# my ($self, $args) = @_;}; }; # use test classes snippet tuse use Test::More; - use Test::Deep (); + use Test::Deep; # (); # uncomment to stop prototype errors use Test::Exception; # local test lib @@ -353,6 +343,7 @@ snippet tprep my $self = shift; ${4:# body} } + # cause failures to print stack trace snippet debug_trace use Carp; # 'verbose'; From 2abf84e6b90d9fb2c38929048bff2da1cb968b40 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:37:23 +1200 Subject: [PATCH 13/20] experimenting with file name in package snippet --- snippets/perl.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index ef30667..9afdee6 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -91,7 +91,7 @@ snippet package # Package syntax perl >= 5.12.0 snippet packagev512 - package ${1:ClassName} ${2:0.99}; + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; ${3:#...} @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - #extends '${2:# ParentClass}'; + ${1:#}extends '${2:# ParentClass}'; # moose extends snippet extends From a42eb6a320285a522847b04e678804850beb6c48 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Wed, 25 Jul 2012 22:43:24 +1200 Subject: [PATCH 14/20] substitute regular package name --- snippets/perl.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 9afdee6..79462fc 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -80,7 +80,7 @@ snippet fore ${1:expression} foreach @${2:array};${3} # Package snippet package - package ${1:ClassName}; + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}; ${2:#...} @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - ${1:#}extends '${2:# ParentClass}'; + ${1:#}extends '${2:ParentClass}'; # moose extends snippet extends From 2f701a905899aac4b364943d0803ddee84b955e2 Mon Sep 17 00:00:00 2001 From: Travis Holton Date: Thu, 26 Jul 2012 09:57:26 +1200 Subject: [PATCH 15/20] put extends in a BEGIN block --- snippets/perl.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 79462fc..dbe9288 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - ${1:#}extends '${2:ParentClass}'; + ${1:#}BEGIN {extends '${2:ParentClass}}'; # moose extends snippet extends From 0d5ecadc576ad095bcdf33c010340ac1e79d1040 Mon Sep 17 00:00:00 2001 From: Travis Holton Date: Thu, 26 Jul 2012 16:07:33 +1200 Subject: [PATCH 16/20] fix quote on moose snippet --- snippets/perl.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index dbe9288..024aee1 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -104,7 +104,7 @@ snippet packagev512 snippet moose use Moose; use namespace::autoclean; - ${1:#}BEGIN {extends '${2:ParentClass}}'; + ${1:#}BEGIN {extends '${2:ParentClass}'}; # moose extends snippet extends From c805b4f24131b05ee85e2a77187a444a260f9639 Mon Sep 17 00:00:00 2001 From: Travis Holton Date: Thu, 26 Jul 2012 16:08:11 +1200 Subject: [PATCH 17/20] put in a goto point to jump to --- snippets/perl.snippets | 1 + 1 file changed, 1 insertion(+) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 024aee1..6416180 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -105,6 +105,7 @@ snippet moose use Moose; use namespace::autoclean; ${1:#}BEGIN {extends '${2:ParentClass}'}; + ${3} # moose extends snippet extends From 4987a54300a90f9d2e35e32a31846bf6f74c1887 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Thu, 26 Jul 2012 21:35:03 +1200 Subject: [PATCH 18/20] took some whitespace out removed some redundant snippets --- snippets/perl.snippets | 52 ++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 6416180..e8de8fb 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -82,68 +82,51 @@ snippet fore snippet package package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}; - ${2:#...} + ${2} 1; __END__ - - -# Package syntax perl >= 5.12.0 -snippet packagev512 +# Package syntax perl >= 5.14 +snippet packagev514 package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; - ${3:#...} + ${3} 1; __END__ - - #moose snippet moose use Moose; use namespace::autoclean; ${1:#}BEGIN {extends '${2:ParentClass}'}; + ${3} - -# moose extends -snippet extends - extends qw(${1:Parent Class}); - # parent snippet parent use parent qw(${1:Parent Class}); - # Read File snippet slurp my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; ${3} - - # strict warnings snippet strwar use strict; use warnings; - - -# standard versioning with perlcritic bypass +# older versioning with perlcritic bypass snippet vers ## no critic our $VERSION = '${1:version}'; eval $VERSION; ## use critic - - # new 'switch' like feature snippet switch use feature 'switch'; - - # Anonymous subroutine snippet asub - sub { + sub { ${1:# body } } @@ -156,19 +139,19 @@ snippet begin } # call package function with some parameter -snippet pkgmv +snippet pkgmv __PACKAGE__->${1:package_method}(${2:var}) # call package function without a parameter -snippet pkgm +snippet pkgm __PACKAGE__->${1:package_method}() # call package "get_" function without a parameter -snippet pkget +snippet pkget __PACKAGE__->get_${1:package_method}() # call package function with a parameter -snippet pkgetv +snippet pkgetv __PACKAGE__->get_${1:package_method}(${2:var}) # complex regex @@ -183,10 +166,10 @@ snippet qr/ #given snippet given - given ($${1:var}) { + given ($${1:var}) { ${2:# cases} ${3:# default} - } + } # switch-like case snippet when @@ -212,7 +195,7 @@ snippet ppod ${1:ClassName} - ${2:ShortDesc} =head1 SYNOPSIS - + use $1; ${3:# synopsis...} @@ -224,7 +207,7 @@ snippet ppod =head1 INTERFACE - + =head1 DEPENDENCIES @@ -254,7 +237,7 @@ snippet parg =item Arguments - + =over 3 =item @@ -277,7 +260,6 @@ snippet parg =back - =back @@ -328,7 +310,7 @@ snippet tsub sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) { my $self = shift; ${4:# body} - + } # Test::Routine-style test From 8e6b144f68de6aa449c08264cd1f4f31a5b45534 Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Thu, 26 Jul 2012 21:41:52 +1200 Subject: [PATCH 19/20] create an inline documented subroutine --- snippets/perl.snippets | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index e8de8fb..bbc9e30 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -228,8 +228,17 @@ snippet psubi =cut +# inline documented subroutine +snippet subpod + =head2 $1 + Summarry of $1 + =cut + + sub ${1:subroutine_name} { + ${2:# body...} + } # Subroutine signature snippet parg =over 2 From b5bb673ee3aa8e74efe16e50cf3009c3098d9c7e Mon Sep 17 00:00:00 2001 From: William Travis Holton Date: Thu, 26 Jul 2012 21:44:58 +1200 Subject: [PATCH 20/20] corrected spelling mistake --- snippets/perl.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/perl.snippets b/snippets/perl.snippets index bbc9e30..9cebede 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -232,7 +232,7 @@ snippet psubi snippet subpod =head2 $1 - Summarry of $1 + Summary of $1 =cut