From 52a35343564f25c29d8c4b1255712544f4957251 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 25 Jan 2009 17:42:48 +1100 Subject: Replace bare word file handle Use local variable. --- scripts/keepalived/vyatta-clear-vrrp.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/keepalived/vyatta-clear-vrrp.pl') diff --git a/scripts/keepalived/vyatta-clear-vrrp.pl b/scripts/keepalived/vyatta-clear-vrrp.pl index a44b0305..a22b4f14 100644 --- a/scripts/keepalived/vyatta-clear-vrrp.pl +++ b/scripts/keepalived/vyatta-clear-vrrp.pl @@ -257,9 +257,10 @@ if ($action eq "clear_master") { # should add a file lock local($/, *FILE); # slurp mode - open FILE, "<", $conf_file or die "Couldn't open $conf_file\n"; - my $conf = ; - close FILE; + + open my $f, '<', $conf_file or die "Couldn't open $conf_file\n"; + my $conf = <$f>; + close $f; my ($new_conf, $match_instance) = vrrp_extract_instance($conf, $instance); if ($match_instance !~ /nopreempt/) { -- cgit v1.2.3