commit c1aaa9fc1179bfa7d1e87ed7476b5d7912005cc5
parent 3039e721afdc85a2431468b27c092139f5a274ee
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Wed, 23 Sep 2020 12:19:13 +0200
vim: fix Perl file reading snippet
Former-commit-id: 99d2fe3b63eb257185555807459b8811613b82c4
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/vim/ultisnips/perl.snippets b/vim/ultisnips/perl.snippets
@@ -1,9 +1,10 @@
snippet readfile "Read from a file" b
-open(${1:handle}, "<${2:filename}") or die "Couldn't open the file $2, \$!";
+open(${1:handle}, "<", "${2:filename}") or die "Couldn't open the file $2, \$!";
-while(<$1>) {
+while(my $line = <$1) {
$0
}
+close($1);
endsnippet
snippet functable "Function dispatch table" b