diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-11-09 08:13:45 -0800 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-11-09 08:13:45 -0800 |
commit | 0e7340bf6b421b698578a908fa67ca6f629d698c (patch) | |
tree | 62fa9e668b6a187459dea86ef1ee6296e5053c5e /scripts | |
parent | 746e88015ecfd2c94d9fe0a348c10497e3be6210 (diff) | |
download | vyatta-op-0e7340bf6b421b698578a908fa67ca6f629d698c.tar.gz vyatta-op-0e7340bf6b421b698578a908fa67ca6f629d698c.zip |
Fix perlcritic warning about bareword file handle
dhcpv6-show-leases use 3 arg open and local file handle
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/dhcpv6-client-show-leases.pl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/dhcpv6-client-show-leases.pl b/scripts/dhcpv6-client-show-leases.pl index 546668c..44be689 100644 --- a/scripts/dhcpv6-client-show-leases.pl +++ b/scripts/dhcpv6-client-show-leases.pl @@ -74,13 +74,11 @@ my %ghash = (); foreach my $lease_filename (@lease_files) { my @lines=(); - if (!open(LEASE_FILE, "</var/lib/dhcp3/$lease_filename")) { - printf("Can't open lease file for reading: $lease_filename\n"); - exit 1; - } + open(my $f, '<', "/var/lib/dhcp3/$lease_filename") + or die "Can't open lease file for reading: $lease_filename\n"; - @lines = <LEASE_FILE>; - close(LEASE_FILE); + @lines = <$f>; + close $f; chomp @lines; my $level = 0; |