From fed052c80a7f8ae58156e34e7c8f3b25cfe90260 Mon Sep 17 00:00:00 2001 From: Steven Humphrey Date: Tue, 18 Dec 2012 09:26:56 +0000 Subject: [PATCH] Adjusted perl snippets for some best practices --- UltiSnips/perl.snippets | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/UltiSnips/perl.snippets b/UltiSnips/perl.snippets index 6a9e8f9..720b7c8 100644 --- a/UltiSnips/perl.snippets +++ b/UltiSnips/perl.snippets @@ -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 = ; close FILE } +my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> }; endsnippet