summaryrefslogtreecommitdiff
path: root/scripts/dhcpv6-client-show-leases.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dhcpv6-client-show-leases.pl')
-rw-r--r--scripts/dhcpv6-client-show-leases.pl10
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;