experimenting with some new perl features

This commit is contained in:
William Travis Holton 2012-05-16 20:32:53 +12:00
parent fab29b6279
commit 75598b4fee

View File

@ -84,28 +84,50 @@ snippet cl
#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} => (