Adjusted perl snippets for some best practices
This commit is contained in:
parent
86dcbf0a27
commit
fed052c80a
@ -49,7 +49,7 @@ ${1:expression} while ${2:condition};
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet test "Test"
|
snippet test "Test"
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/env perl -w
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Test::More tests => ${1:1};
|
use Test::More tests => ${1:1};
|
||||||
@ -105,8 +105,7 @@ if ($1) {
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet slurp "slurp"
|
snippet slurp "slurp"
|
||||||
my $${1:var};
|
my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
|
||||||
{ local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE }
|
|
||||||
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user