Adjusted perl snippets for some best practices

This commit is contained in:
Steven Humphrey 2012-12-18 09:26:56 +00:00
parent 86dcbf0a27
commit fed052c80a

View File

@ -49,7 +49,7 @@ ${1:expression} while ${2:condition};
endsnippet
snippet test "Test"
#!/usr/bin/perl -w
#!/usr/bin/env perl -w
use strict;
use Test::More tests => ${1:1};
@ -105,8 +105,7 @@ if ($1) {
endsnippet
snippet slurp "slurp"
my $${1:var};
{ local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE }
my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
endsnippet