From 62132a44e43c08a9b4a379510c7fcea1cc0aa07d Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 17 Feb 2015 15:06:36 +0100 Subject: Replace count elements in hash for a counting loop... --- scripts/vyos-update-nhrp.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl index 9e83c5f..1d44274 100644 --- a/scripts/vyos-update-nhrp.pl +++ b/scripts/vyos-update-nhrp.pl @@ -279,8 +279,10 @@ sub ipsec_config { $config_prot->setLevel("vpn ipsec esp-group $esp_group"); my @proposals = $config_prot->listNodes("proposal"); - my %proposals = @proposals; - my $x = scalar(keys %proposals); + my $x = 0; + foreach my $e (@proposals) { + $x ++; + } my $y = 0; push(@conf_file, " --esp", " "); foreach my $proposal (@proposals) { @@ -355,8 +357,10 @@ sub ipsec_config { if ($ike_group) { $config_prot->setLevel("vpn ipsec ike-group $ike_group"); my @proposals = $config_prot->listNodes("proposal"); - my %proposals = @proposals; - my $x = scalar(keys %proposals); + my $x = 0; + foreach my $e (@proposals) { + $x ++; + } my $y = 0; push(@conf_file, " --ike", " "); foreach my $proposal (@proposals) { -- cgit v1.2.3