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} => (