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
|
||||
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user