Index: /trunk/klask
===================================================================
--- /trunk/klask	(revision 260)
+++ /trunk/klask	(revision 261)
@@ -45,9 +45,9 @@
 LEVEL_OF_EACH_SWITCH:
 for my $sw (@SWITCH_LIST) {
-   $SWITCH_LEVEL{$sw->{hostname}} = $sw->{'level'} || $DEFAULT{'switch_level'}  || 2;
-   $SWITCH_DB{$sw->{hostname}} = $sw;
+   $SWITCH_LEVEL{$sw->{'hostname'}} = $sw->{'level'} || $DEFAULT{'switch_level'}  || 2;
+   $SWITCH_DB{$sw->{'hostname'}} = $sw;
 
    # SNMP parameter initialisation
-   my %session = ( -hostname   => $sw->{hostname} );
+   my %session = ( -hostname   => $sw->{'hostname'} );
    $session{-version} = $sw->{'version'}  || 1;
    $session{-port}    = $sw->{'snmpport'} || $DEFAULT{'snmpport'}  || 161;
@@ -60,5 +60,5 @@
    $sw->{'snmp_param_session'} = \%session;
    }
-@SWITCH_LIST = reverse sort { $SWITCH_LEVEL{$a->{hostname}} <=> $SWITCH_LEVEL{$b->{hostname}} } @{$KLASK_CFG->{'switch'}};
+@SWITCH_LIST = reverse sort { $SWITCH_LEVEL{$a->{'hostname'}} <=> $SWITCH_LEVEL{$b->{'hostname'}} } @{$KLASK_CFG->{'switch'}};
 
 #my %SWITCH_PORT_COUNT = ();
@@ -273,7 +273,7 @@
    my $packed_ip = scalar gethostbyname($param_ip_or_host);
    return %ret if not defined $packed_ip;
-   $ret{ipv4_address} = inet_ntoa($packed_ip);
-   #if ($ret{ipv4_address} !~ m/$RE_IPv4_ADDRESS/) {
-   #   print "Error: for computer $param_ip_or_host on interface $interface, IP $ret{ipv4_address} is not valide\n";
+   $ret{'ipv4_address'} = inet_ntoa($packed_ip);
+   #if ($ret{'ipv4_address'} !~ m/$RE_IPv4_ADDRESS/) {
+   #   print "Error: for computer $param_ip_or_host on interface $interface, IP $ret{'ipv4_address'} is not valide\n";
    #   return %ret;
    #   }
@@ -281,9 +281,9 @@
    # perl -MSocket -E 'say scalar gethostbyaddr(inet_aton("194.254.66.240"), AF_INET)'
    my $hostname_fq = scalar gethostbyaddr($packed_ip, AF_INET) if $already eq 'yes';
-   $ret{hostname_fq} = $hostname_fq if defined $hostname_fq;
+   $ret{'hostname_fq'} = $hostname_fq if defined $hostname_fq;
 
    # my $cmd = q{grep  -he '\b} . $param_ip_or_host . q{\b' } . "/var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
-   #my $cmd = q{grep  -he '\b} . $ret{ipv4_address} . q{\b' } . "/var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
-   my $cmd = q{grep  -He '\b} . $ret{ipv4_address} . q{\b' } . "/var/lib/arpwatch/$interface.dat" . '| sed -e \'s|^/var/lib/arpwatch/\(.*\)\.dat:|\1 |;\' | sort -rn -k 4,4 | head -1';
+   #my $cmd = q{grep  -he '\b} . $ret{'ipv4_address'} . q{\b' } . "/var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
+   my $cmd = q{grep  -He '\b} . $ret{'ipv4_address'} . q{\b' } . "/var/lib/arpwatch/$interface.dat" . '| sed -e \'s|^/var/lib/arpwatch/\(.*\)\.dat:|\1 |;\' | sort -rn -k 4,4 | head -1';
    #grep -He 194.254.66.252 /var/lib/arpwatch/*.dat | sed -e 's|^/var/lib/arpwatch/\(.*\)\.dat:|\1\t|;' | sort -rn -k 4,4 | head -1
 
@@ -292,12 +292,12 @@
    my ($interface2, $arp, $ip, $timestamp, $host) = split m/ \s+ /xms, $cmd_arpwatch;
 
-   $ret{interface}    = $interface2 || $interface;
-   $ret{mac_address}  = $arp       if $arp;
-   $ret{timestamp}    = $timestamp if $timestamp;
+   $ret{'interface'}    = $interface2 || $interface;
+   $ret{'mac_address'}  = $arp       if $arp;
+   $ret{'timestamp'}    = $timestamp if $timestamp;
 
    my $nowtimestamp = time;
 
    if ( $type eq 'fast' and ( not defined $timestamp or $timestamp < ( $nowtimestamp - 45 * 60 ) ) ) { # 45 min
-      $ret{mac_address} = 'unknow';
+      $ret{'mac_address'} = 'unknow';
       return %ret;
       }
@@ -312,20 +312,20 @@
    # LANG=C ip neigh show to 194.254.66.62
    # 194.254.66.62 dev eth331 lladdr 00:08:7c:bb:0f:c0 REACHABLE
-#   my $cmd_arp  = shell_command "arp -a $param_ip_or_host -i $ret{interface}";
+#   my $cmd_arp  = shell_command "arp -a $param_ip_or_host -i $ret{'interface'}";
 #   if ( $cmd_arp =~ m{ (\S*) \s \( ( $RE_IPv4_ADDRESS ) \) \s at \s ( $RE_MAC_ADDRESS ) }xms ) {
-#      ( $ret{hostname_fq}, $ret{ipv4_address}, $ret{mac_address} )  = ($1, $2, $3);
+#      ( $ret{'hostname_fq'}, $ret{'ipv4_address'}, $ret{'mac_address'} )  = ($1, $2, $3);
 #      }
-   if ($ret{mac_address} eq 'unknow') {
+   if ($ret{'mac_address'} eq 'unknow') {
       # Last chance to have the mac_address
-      if ($ret{interface} eq '*') {
-         my $cmd_arp  = shell_command "ip neigh show to $ret{ipv4_address}";
+      if ($ret{'interface'} eq '*') {
+         my $cmd_arp  = shell_command "ip neigh show to $ret{'ipv4_address'}";
          if ( $cmd_arp =~ m{ ^$RE_IPv4_ADDRESS \s dev \s ([\w\d\.\:]+) \s lladdr \s ( $RE_MAC_ADDRESS ) \s }xms ) {
-            ($ret{interface}, $ret{mac_address}) = ($1, $2);
+            ($ret{'interface'}, $ret{'mac_address'}) = ($1, $2);
             }
          }
       else {
-         my $cmd_arp  = shell_command "ip neigh show to $ret{ipv4_address} dev $ret{interface}";
+         my $cmd_arp  = shell_command "ip neigh show to $ret{'ipv4_address'} dev $ret{'interface'}";
          if ( $cmd_arp =~ m{ ^$RE_IPv4_ADDRESS \s lladdr \s ( $RE_MAC_ADDRESS ) \s }xms ) {
-            $ret{mac_address} = $1;
+            $ret{'mac_address'} = $1;
             }
          }
@@ -333,11 +333,11 @@
 
    # Normalize MAC Address
-   if ($ret{mac_address} ne 'unknow') {
+   if ($ret{'mac_address'} ne 'unknow') {
       my @paquets = ();
-      for ( split m/ : /xms, $ret{mac_address} ) {
+      for ( split m/ : /xms, $ret{'mac_address'} ) {
          my @chars = split m//xms, uc "00$_";
          push @paquets, "$chars[-2]$chars[-1]";
          }
-      $ret{mac_address} = join q{:}, @paquets;
+      $ret{'mac_address'} = join q{:}, @paquets;
       }
 
@@ -375,8 +375,8 @@
       my $result = $session->get_request(
          -varbindlist => [
-            $OID_NUMBER{sysDescription},
-            $OID_NUMBER{sysName},
-            $OID_NUMBER{sysContact},
-            $OID_NUMBER{sysLocation},
+            $OID_NUMBER{'sysDescription'},
+            $OID_NUMBER{'sysName'},
+            $OID_NUMBER{'sysContact'},
+            $OID_NUMBER{'sysLocation'},
             ]
          );
@@ -385,33 +385,33 @@
          $session->close();
          # Remove bad switch
-         @SWITCH_LIST = grep { $_->{hostname} ne $sw->{hostname} } @SWITCH_LIST;
-         delete $SWITCH_LEVEL{$sw->{hostname}} if exists $SWITCH_LEVEL{$sw->{hostname}};
-         delete $SWITCH_DB{$sw->{hostname}}    if exists $SWITCH_DB{$sw->{hostname}};
+         @SWITCH_LIST = grep { $_->{'hostname'} ne $sw->{'hostname'} } @SWITCH_LIST;
+         delete $SWITCH_LEVEL{$sw->{'hostname'}} if exists $SWITCH_LEVEL{$sw->{'hostname'}};
+         delete $SWITCH_DB{$sw->{'hostname'}}    if exists $SWITCH_DB{$sw->{'hostname'}};
          next INIT_EACH_SWITCH;
          }
 
-      $sw->{description} = $result->{$OID_NUMBER{sysName}} || $sw->{hostname};
-      $sw->{model} = get_switch_model($result->{$OID_NUMBER{sysDescription}});
+      $sw->{description} = $result->{$OID_NUMBER{'sysName'}} || $sw->{'hostname'};
+      $sw->{model} = get_switch_model($result->{$OID_NUMBER{'sysDescription'}});
       if ($verb_description) {
-         my $desc = $result->{$OID_NUMBER{sysDescription}};
+         my $desc = $result->{$OID_NUMBER{'sysDescription'}};
          $desc =~ s/[\n\r]/ /g;
          print "   description: $desc\n"
          }
       if ($check_hostname) {
-         my ($hostname) = split /\./, $sw->{hostname}, 2;
-         print " $hostname - error internal hostname: $sw->{hostname}\n" if $result->{$OID_NUMBER{sysName}} ne $hostname;
+         my ($hostname) = split /\./, $sw->{'hostname'}, 2;
+         print " $hostname - error internal hostname: $sw->{'hostname'}\n" if $result->{$OID_NUMBER{'sysName'}} ne $hostname;
          }
       if ($check_location) {
-         my $location = $result->{$OID_NUMBER{sysLocation}};
+         my $location = $result->{$OID_NUMBER{'sysLocation'}};
          $location =~ s/^"(.+)"$/$1/;
-         print " $sw->{hostname} - error location: '$location' -> '$sw->{location}'\n" if $location ne $sw->{location};
-         }
-      #$sw->{location} = $result->{"1.3.6.1.2.1.1.6.0"} || $sw->{hostname};
-      #$sw->{contact} = $result->{"1.3.6.1.2.1.1.4.0"} || $sw->{hostname};
+         print " $sw->{'hostname'} - error location: '$location' -> '$sw->{'location'}'\n" if $location ne $sw->{'location'};
+         }
+      #$sw->{'location'} = $result->{"1.3.6.1.2.1.1.6.0"} || $sw->{'hostname'};
+      #$sw->{contact} = $result->{"1.3.6.1.2.1.1.4.0"} || $sw->{'hostname'};
       $session->close;
 
       # Ligne à virer car on récupère maintenant le modèle du switch
       #my ($desc, $type) = split m/ : /xms, $sw->{description}, 2;
-      printf "%-26s 0--------->>>> %-25s %s\n", $sw->{hostname}, $sw->{description}, $sw->{model} if $verbose;
+      printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{description}, $sw->{model} if $verbose;
       }
 
@@ -490,6 +490,6 @@
 
    my %ret;
-   $ret{switch_description} = 'unknow';
-   $ret{switch_port} = '0';
+   $ret{'switch_description'} = 'unknow';
+   $ret{'switch_port'} = '0';
 
    return %ret if $mac_address eq 'unknow';;
@@ -498,5 +498,5 @@
    if ($switch_proposal ne q{}) {
       for my $sw (@SWITCH_LIST) {
-         next if $sw->{hostname} ne $switch_proposal;
+         next if $sw->{'hostname'} ne $switch_proposal;
          unshift @switch_search, $sw;
          last;
@@ -545,8 +545,8 @@
          }
 
-      $ret{switch_hostname}    = $sw->{hostname};
-      $ret{switch_description} = $sw->{description};
-      $ret{switch_port}        = $swport_num;
-      $ret{switch_port_hr}     = $swport_hr; # human readable
+      $ret{'switch_hostname'}    = $sw->{'hostname'};
+      $ret{'switch_description'} = $sw->{description};
+      $ret{'switch_port'}        = $swport_num;
+      $ret{'switch_port_hr'}     = $swport_hr; # human readable
 
       last LOOP_ON_SWITCH;
@@ -594,9 +594,9 @@
             }
 
-         $ret->{$sw->{hostname}} = {};
-         $ret->{$sw->{hostname}}{hostname}    = $sw->{hostname};
-         $ret->{$sw->{hostname}}{description} = $sw->{description};
-         $ret->{$sw->{hostname}}{port}        = $swport_num;
-         $ret->{$sw->{hostname}}{port_hr}     = $swport_hr;
+         $ret->{$sw->{'hostname'}} = {};
+         $ret->{$sw->{'hostname'}}{'hostname'}    = $sw->{'hostname'};
+         $ret->{$sw->{'hostname'}}{description} = $sw->{description};
+         $ret->{$sw->{'hostname'}}{port}        = $swport_num;
+         $ret->{$sw->{'hostname'}}{'port_hr'}     = $swport_hr;
          }
 
@@ -616,5 +616,5 @@
    my $vlan_name = shift;
 
-   return $KLASK_CFG->{network}{$vlan_name}{interface};
+   return $KLASK_CFG->{network}{$vlan_name}{'interface'};
    }
 
@@ -639,5 +639,5 @@
 
    for my $vlan_name (keys %{$KLASK_CFG->{network}}) {
-      next if $KLASK_CFG->{network}{$vlan_name}{interface} ne $interface;
+      next if $KLASK_CFG->{network}{$vlan_name}{'interface'} ne $interface;
       return $vlan_name;
       }
@@ -723,5 +723,5 @@
    # First get the index, second get the name
 
-   my $research_index = $OID_NUMBER{ifIndex} .'.'. $swport_num;
+   my $research_index = $OID_NUMBER{'ifIndex'} .'.'. $swport_num;
    my $result_index = $snmp_session->get_request(
       -varbindlist => [$research_index]
@@ -738,5 +738,5 @@
    my ($snmp_session, $swport_index) = @_;
 
-   my $research_hr = $OID_NUMBER{ifName} .'.'. $swport_index;
+   my $research_hr = $OID_NUMBER{'ifName'} .'.'. $swport_index;
    my $result_hr = $snmp_session->get_request(
       -varbindlist => [$research_hr]
@@ -747,5 +747,5 @@
    # Aggregator port
    if ($swport_hr =~ m/^(Trk|Br|Po)/) {
-      my $research_index = $OID_NUMBER{ifAggregator}; # base OID
+      my $research_index = $OID_NUMBER{'ifAggregator'}; # base OID
       my @args = ( -varbindlist =>  [$research_index]);
       LOOP_ON_OID_PORT:
@@ -785,5 +785,5 @@
    return $swport_num if $swport_num =~ m/^\d+$/;
 
-   my $research_index = $OID_NUMBER{ifIndex}; # base OID
+   my $research_index = $OID_NUMBER{'ifIndex'}; # base OID
    my @args = ( -varbindlist =>  [$research_index]);
    LOOP_ON_OID_PORT:
@@ -799,5 +799,5 @@
       @args = (-varbindlist => [$oid_current]);
       
-      my $oid_ifName = $OID_NUMBER{ifName} .'.'. $port_ifIndex;
+      my $oid_ifName = $OID_NUMBER{'ifName'} .'.'. $port_ifIndex;
       my $result = $snmp_session->get_request(-varbindlist => [$oid_ifName]);
       next LOOP_ON_OID_PORT if not defined $result;
@@ -823,5 +823,5 @@
    my %vlan = (); # Hash vlan number => vlan name
 
-   my $research_index = $OID_NUMBER{vlanName}; # base OID
+   my $research_index = $OID_NUMBER{'vlanName'}; # base OID
    my @args = ( -varbindlist =>  [$research_index]);
    LOOP_ON_VLAN:
@@ -850,7 +850,7 @@
    for my $ip (keys %{$computerdb}) {
 
-      next LOOP_ON_IP_ADDRESS if exists $computerdb->{$ip}{switch_port_hr} and defined $computerdb->{$ip}{switch_port_hr};
-
-      $computerdb->{$ip}{switch_port_hr} = $computerdb->{$ip}{switch_port};
+      next LOOP_ON_IP_ADDRESS if exists $computerdb->{$ip}{'switch_port_hr'} and defined $computerdb->{$ip}{'switch_port_hr'};
+
+      $computerdb->{$ip}{'switch_port_hr'} = $computerdb->{$ip}{'switch_port'};
       }
 
@@ -923,16 +923,16 @@
    for my $clientname (@computer) {
       my %resol_arp = resolve_ip_arp_host($clientname);          #resolution arp
-      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{interface});
+      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{'interface'});
       my $vlan_id   = get_current_vlan_id($vlan_name);
-      my %where     = find_switch_port($resol_arp{mac_address}, '', $vlan_id); #retrouve l'emplacement
-
-      next LOOP_ON_COMPUTER if $where{switch_description} eq 'unknow' or $resol_arp{hostname_fq} eq 'unknow' or $resol_arp{mac_address} eq 'unknow';
+      my %where     = find_switch_port($resol_arp{'mac_address'}, '', $vlan_id); #retrouve l'emplacement
+
+      next LOOP_ON_COMPUTER if $where{'switch_description'} eq 'unknow' or $resol_arp{'hostname_fq'} eq 'unknow' or $resol_arp{'mac_address'} eq 'unknow';
 
       printf '%-22s %2s %-30s %-15s %18s',
-         $where{switch_hostname},
-         $where{switch_port_hr},
-         $resol_arp{hostname_fq},
-         $resol_arp{ipv4_address},
-         $resol_arp{mac_address}."\n";
+         $where{'switch_hostname'},
+         $where{'switch_port_hr'},
+         $resol_arp{'hostname_fq'},
+         $resol_arp{'ipv4_address'},
+         $resol_arp{'mac_address'}."\n";
       }
    return;
@@ -971,9 +971,9 @@
    for my $clientname (@computer) {
       my %resol_arp = resolve_ip_arp_host($clientname);      #resolution arp
-      my $ip = $resol_arp{ipv4_address};
+      my $ip = $resol_arp{'ipv4_address'};
 
       next LOOP_ON_COMPUTER unless exists $computerdb->{$ip};
 
-      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{timestamp};
+      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{'timestamp'};
       $year += 1900;
       $mon++;
@@ -981,9 +981,9 @@
 
       printf "%-22s %2s %-30s %-15s %-18s %s\n",
-         $computerdb->{$ip}{switch_hostname},
-         $computerdb->{$ip}{switch_port_hr},
-         $computerdb->{$ip}{hostname_fq},
+         $computerdb->{$ip}{'switch_hostname'},
+         $computerdb->{$ip}{'switch_port_hr'},
+         $computerdb->{$ip}{'hostname_fq'},
          $ip,
-         $computerdb->{$ip}{mac_address},
+         $computerdb->{$ip}{'mac_address'},
          $date;
       }
@@ -1001,7 +1001,7 @@
       LOOP_ON_COMPUTER:
       for my $ip (keys %{$computerdb}) {
-         next LOOP_ON_COMPUTER if $mac ne $computerdb->{$ip}{mac_address};
-
-         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{timestamp};
+         next LOOP_ON_COMPUTER if $mac ne $computerdb->{$ip}{'mac_address'};
+
+         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{'timestamp'};
          $year += 1900;
          $mon++;
@@ -1009,9 +1009,9 @@
 
          printf "%-22s %2s %-30s %-15s %-18s %s\n",
-            $computerdb->{$ip}{switch_hostname},
-            $computerdb->{$ip}{switch_port_hr},
-            $computerdb->{$ip}{hostname_fq},
+            $computerdb->{$ip}{'switch_hostname'},
+            $computerdb->{$ip}{'switch_port_hr'},
+            $computerdb->{$ip}{'hostname_fq'},
             $ip,
-            $computerdb->{$ip}{mac_address},
+            $computerdb->{$ip}{'mac_address'},
             $date;
          #next LOOP_ON_MAC;
@@ -1057,6 +1057,6 @@
    { # Remplis le champs portignore des ports d'inter-connection pour chaque switch
    my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE");
-   my %db_switch_output_port       = %{$switch_connection->{output_port}};
-   my %db_switch_connected_on_port = %{$switch_connection->{connected_on_port}};
+   my %db_switch_output_port       = %{$switch_connection->{'output_port'}};
+   my %db_switch_connected_on_port = %{$switch_connection->{'connected_on_port'}};
    my %db_switch_chained_port = ();
    for my $swport (keys %db_switch_connected_on_port) {
@@ -1065,10 +1065,10 @@
       }
    for my $sw (@SWITCH_LIST) {
-      push @{$sw->{portignore}}, $db_switch_output_port{$sw->{hostname}}  if exists $db_switch_output_port{$sw->{hostname}};
-      if ( exists $db_switch_chained_port{$sw->{hostname}} ) {
-         chop $db_switch_chained_port{$sw->{hostname}};
-         push @{$sw->{portignore}}, split m/ : /xms, $db_switch_chained_port{$sw->{hostname}};
-         }
-#      print "$sw->{hostname} ++ @{$sw->{portignore}}\n";
+      push @{$sw->{portignore}}, $db_switch_output_port{$sw->{'hostname'}}  if exists $db_switch_output_port{$sw->{'hostname'}};
+      if ( exists $db_switch_chained_port{$sw->{'hostname'}} ) {
+         chop $db_switch_chained_port{$sw->{'hostname'}};
+         push @{$sw->{portignore}}, split m/ : /xms, $db_switch_chained_port{$sw->{'hostname'}};
+         }
+#      print "$sw->{'hostname'} ++ @{$sw->{portignore}}\n";
       }
    }
@@ -1079,5 +1079,5 @@
    for my $one_router ( get_list_main_router(@network) ) {
       my %resol_arp = resolve_ip_arp_host($one_router);
-      $router_mac_ip{ $resol_arp{mac_address} } = $resol_arp{ipv4_address};
+      $router_mac_ip{ $resol_arp{'mac_address'} } = $resol_arp{'ipv4_address'};
       }
 
@@ -1112,5 +1112,5 @@
 
          # do not search on router connection (why ?)
-         if ( exists $router_mac_ip{$resol_arp{mac_address}}) {
+         if ( exists $router_mac_ip{$resol_arp{'mac_address'}}) {
             $computer_not_detected{$one_computer} = $current_net;
             next LOOP_ON_COMPUTER;
@@ -1118,5 +1118,5 @@
 
          # do not search on switch inter-connection
-         if (exists $SWITCH_LEVEL{$resol_arp{hostname_fq}}) {
+         if (exists $SWITCH_LEVEL{$resol_arp{'hostname_fq'}}) {
             $computer_not_detected{$one_computer} = $current_net;
             next LOOP_ON_COMPUTER;
@@ -1124,17 +1124,17 @@
 
          my $switch_proposal = q{};
-         if (exists $computerdb->{$resol_arp{ipv4_address}} and exists $computerdb->{$resol_arp{ipv4_address}}{switch_hostname}) {
-            $switch_proposal = $computerdb->{$resol_arp{ipv4_address}}{switch_hostname};
+         if (exists $computerdb->{$resol_arp{'ipv4_address'}} and exists $computerdb->{$resol_arp{'ipv4_address'}}{'switch_hostname'}) {
+            $switch_proposal = $computerdb->{$resol_arp{'ipv4_address'}}{'switch_hostname'};
             }
 
          # do not have a mac address
-         if ($resol_arp{mac_address} eq 'unknow' or (exists $resol_arp{timestamps} and $resol_arp{timestamps} < ($timestamp - 3 * 3600))) {
+         if ($resol_arp{'mac_address'} eq 'unknow' or (exists $resol_arp{'timestamps'} and $resol_arp{'timestamps'} < ($timestamp - 3 * 3600))) {
             $computer_not_detected{$one_computer} = $current_net;
             next LOOP_ON_COMPUTER;
             }
 
-         my $vlan_name = get_current_vlan_name_for_interface($resol_arp{interface});
+         my $vlan_name = get_current_vlan_name_for_interface($resol_arp{'interface'});
          my $vlan_id   = get_current_vlan_id($vlan_name);
-         my %where = find_switch_port($resol_arp{mac_address},$switch_proposal,$vlan_id);
+         my %where = find_switch_port($resol_arp{'mac_address'}, $switch_proposal,$vlan_id);
 
          #192.168.24.156:
@@ -1146,5 +1146,5 @@
 
          # do not have a mac address
-#         if ($resol_arp{mac_address} eq 'unknow') {
+#         if ($resol_arp{'mac_address'} eq 'unknow') {
 #            $computer_not_detected{$one_computer} = $current_interface;
 #            next LOOP_ON_COMPUTER;
@@ -1152,13 +1152,13 @@
 
          # detected on a switch
-         if ($where{switch_description} ne 'unknow') {
+         if ($where{'switch_description'} ne 'unknow') {
             $detected_computer++;
-            $computerdb->{$resol_arp{ipv4_address}} = {
-               hostname_fq        => $resol_arp{hostname_fq},
-               mac_address        => $resol_arp{mac_address},
-               switch_hostname    => $where{switch_hostname},
-               switch_description => $where{switch_description},
-               switch_port        => $where{switch_port},
-               switch_port_hr     => $where{switch_port_hr},
+            $computerdb->{$resol_arp{'ipv4_address'}} = {
+               hostname_fq        => $resol_arp{'hostname_fq'},
+               mac_address        => $resol_arp{'mac_address'},
+               switch_hostname    => $where{'switch_hostname'},
+               switch_description => $where{'switch_description'},
+               switch_port        => $where{'switch_port'},
+               switch_port_hr     => $where{'switch_port_hr'},
                timestamp          => $timestamp,
                network            => $current_net,
@@ -1168,14 +1168,14 @@
 
          # new in the database but where it is ?
-         if (not exists $computerdb->{$resol_arp{ipv4_address}}) {
+         if (not exists $computerdb->{$resol_arp{'ipv4_address'}}) {
             $detected_computer++;
-            $computerdb->{$resol_arp{ipv4_address}} = {
-               hostname_fq        => $resol_arp{hostname_fq},
-               mac_address        => $resol_arp{mac_address},
-               switch_hostname    => $where{switch_hostname},
-               switch_description => $where{switch_description},
-               switch_port        => $where{switch_port},
-               switch_port_hr     => $where{switch_port_hr},
-               timestamp          => $resol_arp{timestamp},
+            $computerdb->{$resol_arp{'ipv4_address'}} = {
+               hostname_fq        => $resol_arp{'hostname_fq'},
+               mac_address        => $resol_arp{'mac_address'},
+               switch_hostname    => $where{'switch_hostname'},
+               switch_description => $where{'switch_description'},
+               switch_port        => $where{'switch_port'},
+               switch_port_hr     => $where{'switch_port_hr'},
+               timestamp          => $resol_arp{'timestamp'},
                network            => $current_net,
                };
@@ -1183,12 +1183,12 @@
 
          # mise a jour du nom de la machine si modification dans le dns
-         $computerdb->{$resol_arp{ipv4_address}}{hostname_fq} = $resol_arp{hostname_fq};
+         $computerdb->{$resol_arp{'ipv4_address'}}{'hostname_fq'} = $resol_arp{'hostname_fq'};
 
          # mise à jour de la date de détection si détection plus récente par arpwatch
-         $computerdb->{$resol_arp{ipv4_address}}{timestamp}   = $resol_arp{timestamp} if exists $resol_arp{timestamp} and $computerdb->{$resol_arp{ipv4_address}}{timestamp} < $resol_arp{timestamp};
+         $computerdb->{$resol_arp{'ipv4_address'}}{'timestamp'}   = $resol_arp{'timestamp'} if exists $resol_arp{'timestamp'} and $computerdb->{$resol_arp{'ipv4_address'}}{'timestamp'} < $resol_arp{'timestamp'};
 
          # relance un arping sur la machine si celle-ci n'a pas été détectée depuis plus d'une semaine
-#         push @computer_not_detected, $resol_arp{ipv4_address} if $computerdb->{$resol_arp{ipv4_address}}{timestamp} < $timestamp_last_week;
-         $computer_not_detected{$resol_arp{ipv4_address}} = $current_net if $computerdb->{$resol_arp{ipv4_address}}{timestamp} < $timestamp_last_week;
+#         push @computer_not_detected, $resol_arp{'ipv4_address'} if $computerdb->{$resol_arp{'ipv4_address'}}{'timestamp'} < $timestamp_last_week;
+         $computer_not_detected{$resol_arp{'ipv4_address'}} = $current_net if $computerdb->{$resol_arp{'ipv4_address'}}{'timestamp'} < $timestamp_last_week;
 
          }
@@ -1230,5 +1230,5 @@
       my %resol_arp = resolve_ip_arp_host($one_computer);
 
-      delete $computerdb->{$resol_arp{ipv4_address}} if exists $computerdb->{$resol_arp{ipv4_address}};
+      delete $computerdb->{$resol_arp{'ipv4_address'}} if exists $computerdb->{$resol_arp{'ipv4_address'}};
       }
 
@@ -1275,8 +1275,8 @@
             not exists $computerdb->{$ip};
 
-            #&& $computerdb->{$ip}{timestamp} > $timestamp_barrier;
-         my $ip_timestamp   = $computerdb->{$ip}{timestamp};
-         my $ip_mac         = $computerdb->{$ip}{mac_address};
-         my $ip_hostname_fq = $computerdb->{$ip}{hostname_fq};
+            #&& $computerdb->{$ip}{'timestamp'} > $timestamp_barrier;
+         my $ip_timestamp   = $computerdb->{$ip}{'timestamp'};
+         my $ip_mac         = $computerdb->{$ip}{'mac_address'};
+         my $ip_hostname_fq = $computerdb->{$ip}{'hostname_fq'};
 
          $mactimedb{$ip_mac} ||= {
@@ -1288,12 +1288,12 @@
 
          if (
-            ( $mactimedb{$ip_mac}->{timestamp} - $ip_timestamp > $timestamp_barrier
+            ( $mactimedb{$ip_mac}->{'timestamp'} - $ip_timestamp > $timestamp_barrier
                or (
-                  $mactimedb{$ip_mac}->{timestamp} > $ip_timestamp
-                  and $timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_3month
+                  $mactimedb{$ip_mac}->{'timestamp'} > $ip_timestamp
+                  and $timestamp - $mactimedb{$ip_mac}->{'timestamp'} > $timestamp_3month
                   )
             )
             and (
-               not $mactimedb{$ip_mac}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/
+               not $mactimedb{$ip_mac}->{'hostname_fq'} =~ m/$RE_FLOAT_HOSTNAME/
                or $ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/
                )) {
@@ -1304,7 +1304,7 @@
 
          elsif (
-            ( $ip_timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_barrier
+            ( $ip_timestamp - $mactimedb{$ip_mac}->{'timestamp'} > $timestamp_barrier
                or (
-                  $ip_timestamp > $mactimedb{$ip_mac}->{timestamp}
+                  $ip_timestamp > $mactimedb{$ip_mac}->{'timestamp'}
                   and $timestamp - $ip_timestamp > $timestamp_3month
                   )
@@ -1312,5 +1312,5 @@
             and (
                not $ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/
-               or $mactimedb{$ip_mac}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/
+               or $mactimedb{$ip_mac}->{'hostname_fq'} =~ m/$RE_FLOAT_HOSTNAME/
                )) {
             print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose;
@@ -1319,5 +1319,5 @@
             }
 
-         if ( $ip_timestamp > $mactimedb{$ip_mac}->{timestamp}) {
+         if ( $ip_timestamp > $mactimedb{$ip_mac}->{'timestamp'}) {
             $mactimedb{$ip_mac} = {
                ip          => $ip,
@@ -1333,5 +1333,5 @@
       LOOP_ON_IP_ADDRESS:
       for my $ip (keys %{$computerdb}) {
-         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} ne 'unknow';
+         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} ne 'unknow';
 
          my $packed_ip = scalar gethostbyname($ip);
@@ -1341,5 +1341,5 @@
          next LOOP_ON_IP_ADDRESS if not defined $hostname_fq;
 
-         $computerdb->{$ip}{hostname_fq} = $hostname_fq;
+         $computerdb->{$ip}{'hostname_fq'} = $hostname_fq;
          $database_has_changed++;
          }
@@ -1389,7 +1389,7 @@
 
       # to be improve in the future
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself !
-
-      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{timestamp};
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself !
+
+      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{'timestamp'};
       $year += 1900;
       $mon++;
@@ -1400,13 +1400,13 @@
 
       my $arrow ='<-----------';
-         $arrow ='<===========' if $computerdb->{$ip}{switch_port_hr} =~ m/^(Trk|Br|Po)/;
+         $arrow ='<===========' if $computerdb->{$ip}{'switch_port_hr'} =~ m/^(Trk|Br|Po)/;
 
       printf "%-28s %8s %12s %-40s %-15s %-18s %-16s %s\n",
-         $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description},
-         $computerdb->{$ip}{switch_port_hr},
+         $computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'},
+         $computerdb->{$ip}{'switch_port_hr'},
          $arrow,
-         $computerdb->{$ip}{hostname_fq},
+         $computerdb->{$ip}{'hostname_fq'},
          $ip,
-         $computerdb->{$ip}{mac_address},
+         $computerdb->{$ip}{'mac_address'},
          $date,
          $vlan;
@@ -1459,7 +1459,7 @@
 
       # to be improve in the future
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself !
-
-      $mac_count{$computerdb->{$ip}{mac_address}}++;
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself !
+
+      $mac_count{$computerdb->{$ip}{'mac_address'}}++;
       }
 
@@ -1470,7 +1470,7 @@
 
       # to be improve in the future
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself !
-
-      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{timestamp};
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself !
+
+      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{'timestamp'};
       $year += 1900;
       $mon++;
@@ -1482,21 +1482,21 @@
 
       my $arrow ='&#8592;';
-         $arrow ='&#8656;' if $computerdb->{$ip}{switch_port_hr} =~ m/^(Trk|Br|Po)/;
-
-      my $switch_hostname = $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description} || 'unkown';
+         $arrow ='&#8656;' if $computerdb->{$ip}{'switch_port_hr'} =~ m/^(Trk|Br|Po)/;
+
+      my $switch_hostname = $computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'} || 'unkown';
       chomp $switch_hostname;
-      my $switch_hostname_sort = sprintf '%s %3s' ,$switch_hostname, $computerdb->{$ip}{switch_port_hr};
+      my $switch_hostname_sort = sprintf '%s %3s' ,$switch_hostname, $computerdb->{$ip}{'switch_port_hr'};
 
       my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ip;
 
-      my $mac_sort = sprintf '%04i-%s', 9999 - $mac_count{$computerdb->{$ip}{mac_address}}, $computerdb->{$ip}{mac_address};
-
-      $computerdb->{$ip}{hostname_fq} = 'unknow' if $computerdb->{$ip}{hostname_fq} =~ m/^ \d+ \. \d+ \. \d+ \. \d+ $/xms;
-      my ( $host_short ) = split m/ \. /xms, $computerdb->{$ip}{hostname_fq};
+      my $mac_sort = sprintf '%04i-%s', 9999 - $mac_count{$computerdb->{$ip}{'mac_address'}}, $computerdb->{$ip}{'mac_address'};
+
+      $computerdb->{$ip}{'hostname_fq'} = 'unknow' if $computerdb->{$ip}{'hostname_fq'} =~ m/^ \d+ \. \d+ \. \d+ \. \d+ $/xms;
+      my ( $host_short ) = split m/ \. /xms, $computerdb->{$ip}{'hostname_fq'};
 
       my $vlan = '';
       $vlan = $computerdb->{$ip}{network}.' ('.get_current_vlan_id($computerdb->{$ip}{network}).')' if $computerdb->{$ip}{network};
 
-      my $parent_port_hr = format_aggregator4html($computerdb->{$ip}{switch_port_hr});
+      my $parent_port_hr = format_aggregator4html($computerdb->{$ip}{'switch_port_hr'});
 
       print <<"END_HTML";
@@ -1505,7 +1505,7 @@
    <td class="bklask-port">$parent_port_hr</td>
    <td colspan="2">$arrow</td>
-   <td sorttable_customkey="$host_short">$computerdb->{$ip}{hostname_fq}</td>
+   <td sorttable_customkey="$host_short">$computerdb->{$ip}{'hostname_fq'}</td>
    <td sorttable_customkey="$ip_sort">$ip</td>
-   <td sorttable_customkey="$mac_sort">$computerdb->{$ip}{mac_address}</td>
+   <td sorttable_customkey="$mac_sort">$computerdb->{$ip}{'mac_address'}</td>
    <td>$vlan</td>
    <td>$date</td>
@@ -1516,8 +1516,8 @@
    my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE");
 
-   my %db_switch_output_port       = %{$switch_connection->{output_port}};
-   my %db_switch_parent            = %{$switch_connection->{parent}};
-   my %db_switch_connected_on_port = %{$switch_connection->{connected_on_port}};
-   my %db_switch                   = %{$switch_connection->{switch_db}};
+   my %db_switch_output_port       = %{$switch_connection->{'output_port'}};
+   my %db_switch_parent            = %{$switch_connection->{'parent'}};
+   my %db_switch_connected_on_port = %{$switch_connection->{'connected_on_port'}};
+   my %db_switch                   = %{$switch_connection->{'switch_db'}};
 
    for my $sw (sort keys %db_switch_output_port) {
@@ -1531,7 +1531,7 @@
 
       if (exists $db_switch_parent{$sw}) {
-         my $mac_address = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{mac_address};
-         my $ipv4_address = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{ipv4_address};
-         my $timestamp = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{timestamp};
+         my $mac_address  = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'mac_address'};
+         my $ipv4_address = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'ipv4_address'};
+         my $timestamp    = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'timestamp'};
 
          my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
@@ -1544,8 +1544,8 @@
          my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
 
-         my ( $host_short ) = sprintf '%s %3s' , split(m/ \. /xms, $db_switch_parent{$sw}->{'switch'}, 1), $db_switch_parent{$sw}->{port_hr};
+         my ( $host_short ) = sprintf '%s %3s' , split(m/ \. /xms, $db_switch_parent{$sw}->{'switch'}, 1), $db_switch_parent{$sw}->{'port_hr'};
 
          my $parent_port_hr = format_aggregator4html($db_switch_output_port{$sw});
-         my $child_port_hr  = format_aggregator4html($db_switch_parent{$sw}->{port_hr});
+         my $child_port_hr  = format_aggregator4html($db_switch_parent{$sw}->{'port_hr'});
 
          print <<"END_HTML";
@@ -1586,7 +1586,7 @@
          my $switch_hostname_sort = sprintf '%s %3s' ,$sw_connect, $port_connect;
 
-         my $mac_address = $db_switch{$sw}->{mac_address};
-         my $ipv4_address = $db_switch{$sw}->{ipv4_address};
-         my $timestamp = $db_switch{$sw}->{timestamp};
+         my $mac_address = $db_switch{$sw}->{'mac_address'};
+         my $ipv4_address = $db_switch{$sw}->{'ipv4_address'};
+         my $timestamp = $db_switch{$sw}->{'timestamp'};
 
          my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
@@ -1670,15 +1670,15 @@
    for my $ip (keys %{$computerdb}) {
       # to be improve in the future
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself !
-      next LOOP_ON_IP_ADDRESS if ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}) eq 'unknow';
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{switch_port} eq '0';
-
-      my $ip_timestamp   = $computerdb->{$ip}{timestamp};
-      my $ip_mac         = $computerdb->{$ip}{mac_address};
-      my $ip_hostname_fq = $computerdb->{$ip}{hostname_fq};
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself !
+      next LOOP_ON_IP_ADDRESS if ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}) eq 'unknow';
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'switch_port'} eq '0';
+
+      my $ip_timestamp   = $computerdb->{$ip}{'timestamp'};
+      my $ip_mac         = $computerdb->{$ip}{'mac_address'};
+      my $ip_hostname_fq = $computerdb->{$ip}{'hostname_fq'};
 
       my $swpt = sprintf "%-28s  %2s",
-         $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description},
-         $computerdb->{$ip}{switch_port_hr};
+         $computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'},
+         $computerdb->{$ip}{'switch_port_hr'};
       $switchportdb{$swpt} ||= {
          ip          => $ip,
@@ -1691,7 +1691,7 @@
       # if float computer, set date 15 day before warning...
       my $ip_timestamp_mod = $ip_timestamp;
-      my $ip_timestamp_ref = $switchportdb{$swpt}->{timestamp};
+      my $ip_timestamp_ref = $switchportdb{$swpt}->{'timestamp'};
       $ip_timestamp_mod -= $days_before_alert * 24 * 3600 if $ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/;
-      $ip_timestamp_ref -= $days_before_alert * 24 * 3600 if $switchportdb{$swpt}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/;
+      $ip_timestamp_ref -= $days_before_alert * 24 * 3600 if $switchportdb{$swpt}->{'hostname_fq'} =~ m/$RE_FLOAT_HOSTNAME/;
 
       if ($ip_timestamp_mod > $ip_timestamp_ref) {
@@ -1709,5 +1709,5 @@
    for my $swpt (keys %switchportdb) {
       next LOOP_ON_RECENT_COMPUTER if $swpt =~ m/^\s*0$/;
-      next LOOP_ON_RECENT_COMPUTER if $switchportdb{$swpt}->{hostname_fq} !~ m/$RE_FLOAT_HOSTNAME/;
+      next LOOP_ON_RECENT_COMPUTER if $switchportdb{$swpt}->{'hostname_fq'} !~ m/$RE_FLOAT_HOSTNAME/;
 
       my $src_ip = $switchportdb{$swpt}->{ip};
@@ -1715,22 +1715,22 @@
       LOOP_ON_IP_ADDRESS:
       for my $ip (keys %{$computerdb}) {
-         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{mac_address} ne  $switchportdb{$swpt}->{mac_address};
-         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/;
-         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{timestamp} < $src_timestamp;
+         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'mac_address'} ne  $switchportdb{$swpt}->{'mac_address'};
+         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} =~ m/$RE_FLOAT_HOSTNAME/;
+         next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'timestamp'} < $src_timestamp;
 
          $src_ip = $ip;
-         $src_timestamp = $computerdb->{$ip}{timestamp};
+         $src_timestamp = $computerdb->{$ip}{'timestamp'};
          }
 
       # keep only if float computer is the most recent
       next LOOP_ON_RECENT_COMPUTER if $src_timestamp == 0;
-      next LOOP_ON_RECENT_COMPUTER if $switchportdb{$swpt}->{timestamp} < $src_timestamp;
-
-      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $switchportdb{$swpt}->{timestamp};
+      next LOOP_ON_RECENT_COMPUTER if $switchportdb{$swpt}->{'timestamp'} < $src_timestamp;
+
+      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $switchportdb{$swpt}->{'timestamp'};
       $year += 1900;
       $mon++;
       my $date = sprintf '%04i-%02i-%02i/%02i:%02i', $year, $mon, $mday, $hour, $min;
 
-      ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$src_ip}{timestamp};
+      ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$src_ip}{'timestamp'};
       $year += 1900;
       $mon++;
@@ -1740,9 +1740,9 @@
 
       printf "%s / %-10s +-> %-10s(%i)  %s %s %s %s\n",
-         $swpt, $switchportdb{$swpt}->{vlan}, $computerdb->{$src_ip}{network}, $vlan_id,
+         $swpt, $switchportdb{$swpt}->{'vlan'}, $computerdb->{$src_ip}{network}, $vlan_id,
          $date,
          $src_date,
-         $computerdb->{$src_ip}{mac_address},
-         $computerdb->{$src_ip}{hostname_fq};
+         $computerdb->{$src_ip}{'mac_address'},
+         $computerdb->{$src_ip}{'hostname_fq'};
       }
    }
@@ -1880,5 +1880,5 @@
       }
 
-   $switch_name = join(',', map {$_->{hostname}} @SWITCH_LIST ) if $switch_name eq q{*};
+   $switch_name = join(',', map {$_->{'hostname'}} @SWITCH_LIST ) if $switch_name eq q{*};
 
    for my $sw_name (split /,/, $switch_name) {
@@ -2010,5 +2010,5 @@
       }
 
-   $switch_name = join(',', map {$_->{hostname}} @SWITCH_LIST ) if $switch_name eq q{*};
+   $switch_name = join(',', map {$_->{'hostname'}} @SWITCH_LIST ) if $switch_name eq q{*};
 
    for my $sw_name (split /,/, $switch_name) {
@@ -2017,5 +2017,5 @@
          }
 
-      my $search_vlan_name = $OID_NUMBER{vlanName} . ".$vlan_id";
+      my $search_vlan_name = $OID_NUMBER{'vlanName'} . ".$vlan_id";
 
       my $sw = $SWITCH_DB{$sw_name};
@@ -2048,5 +2048,5 @@
       }
 
-   $switch_name = join(',', map {$_->{hostname}} @SWITCH_LIST ) if $switch_name eq q{*};
+   $switch_name = join(',', map {$_->{'hostname'}} @SWITCH_LIST ) if $switch_name eq q{*};
 
    for my $sw_name (split /,/, $switch_name) {
@@ -2077,7 +2077,7 @@
    for my $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) {
 
-      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself !
-
-      my $sw_hostname = $computerdb->{$ip}{switch_hostname} || q{};
+      next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself !
+
+      my $sw_hostname = $computerdb->{$ip}{'switch_hostname'} || q{};
       next LOOP_ON_IP_ADDRESS if $sw_hostname eq 'unknow';
 
@@ -2085,6 +2085,6 @@
       LOOP_ON_ALL_SWITCH:
       for my $sw (@SWITCH_LIST) {
-         next LOOP_ON_ALL_SWITCH if $sw_hostname ne $sw->{hostname};
-         $sw_location = $sw->{location};
+         next LOOP_ON_ALL_SWITCH if $sw_hostname ne $sw->{'hostname'};
+         $sw_location = $sw->{'location'};
          last;
          }
@@ -2136,11 +2136,11 @@
 
          if (exists $computerdb->{$ip}) {
-            next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{timestamp} > $timestamp_barrier;
-
-            my $mac_address = $computerdb->{$ip}{mac_address};
+            next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'timestamp'} > $timestamp_barrier;
+
+            my $mac_address = $computerdb->{$ip}{'mac_address'};
             LOOP_ON_DATABASE:
             for my $ip_db (keys %{$computerdb}) {
-               next LOOP_ON_DATABASE if $computerdb->{$ip_db}{mac_address} ne $mac_address;
-               next LOOP_ON_IP_ADDRESS if $computerdb->{$ip_db}{timestamp} > $timestamp_barrier;
+               next LOOP_ON_DATABASE if $computerdb->{$ip_db}{'mac_address'} ne $mac_address;
+               next LOOP_ON_IP_ADDRESS if $computerdb->{$ip_db}{'timestamp'} > $timestamp_barrier;
                }
             }
@@ -2148,5 +2148,5 @@
          my $ip_date_last_detection = '';
          if (exists $computerdb->{$ip}) {
-            my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{timestamp};
+            my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $computerdb->{$ip}{'timestamp'};
             $year += 1900;
             $mon++;
@@ -2161,7 +2161,7 @@
 
          $result_ip{$ip} ||= {};
-         $result_ip{$ip}->{date_last_detection} = $ip_date_last_detection;
-         $result_ip{$ip}->{hostname_fq} = $hostname_fq;
-         $result_ip{$ip}->{vlan} = $vlan;
+         $result_ip{$ip}->{'date_last_detection'} = $ip_date_last_detection;
+         $result_ip{$ip}->{'hostname_fq'} = $hostname_fq;
+         $result_ip{$ip}->{'vlan'} = $vlan;
 
          printf "VERBOSE_1: %-15s %-12s %s\n", $ip, $vlan, $hostname_fq if $verbose;
@@ -2180,6 +2180,6 @@
    LOOP_ON_IP_ADDRESS:
    for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) {
-         my $vlan_nameid = $result_ip{$ip}->{vlan}.'('.get_current_vlan_id($result_ip{$ip}->{vlan}).')';
-         printf "%-15s %-40s %-16s %s\n", $ip, $result_ip{$ip}->{hostname_fq}, $result_ip{$ip}->{date_last_detection}, $vlan_nameid;
+         my $vlan_nameid = $result_ip{$ip}->{'vlan'}.'('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')';
+         printf "%-15s %-40s %-16s %s\n", $ip, $result_ip{$ip}->{'hostname_fq'}, $result_ip{$ip}->{'date_last_detection'}, $vlan_nameid;
       }
    }
@@ -2219,14 +2219,14 @@
 
       my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ip;
-      my ( $host_short ) = split m/ \. /xms, $result_ip{$ip}->{hostname_fq};
-
-      my $vlan_nameid = $result_ip{$ip}->{vlan}.'('.get_current_vlan_id($result_ip{$ip}->{vlan}).')';
+      my ( $host_short ) = split m/ \. /xms, $result_ip{$ip}->{'hostname_fq'};
+
+      my $vlan_nameid = $result_ip{$ip}->{'vlan'}.'('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')';
 
       print <<"END_HTML";
   <tr class="$typerow">
    <td sorttable_customkey="$ip_sort">$ip</td>
-   <td sorttable_customkey="$host_short">$result_ip{$ip}->{hostname_fq}</td>
+   <td sorttable_customkey="$host_short">$result_ip{$ip}->{'hostname_fq'}</td>
    <td>$vlan_nameid</td>
-   <td>$result_ip{$ip}->{date_last_detection}</td>
+   <td>$result_ip{$ip}->{'date_last_detection'}</td>
   </tr>
 END_HTML
@@ -2392,5 +2392,5 @@
 
    $mac_address = normalize_mac_address($mac_address);
-   $switch_name = join(',', map {$_->{hostname}} @SWITCH_LIST ) if $switch_name eq q{*} or $switch_name eq q{all};
+   $switch_name = join(',', map {$_->{'hostname'}} @SWITCH_LIST ) if $switch_name eq q{*} or $switch_name eq q{all};
 
    for my $sw_name (split /,/, $switch_name) {
@@ -2454,10 +2454,10 @@
       my %resol_arp = resolve_ip_arp_host($one_router, q{*}, q{low}); # resolution arp
 
-      next DETECT_ALL_ROUTER if $resol_arp{mac_address} eq 'unknow';
-      print "VERBOSE_1: Router detected $resol_arp{ipv4_address} - $resol_arp{mac_address}\n" if $verbose;
-
-      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{interface});
+      next DETECT_ALL_ROUTER if $resol_arp{'mac_address'} eq 'unknow';
+      print "VERBOSE_1: Router detected $resol_arp{'ipv4_address'} - $resol_arp{'mac_address'}\n" if $verbose;
+
+      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{'interface'});
       my $vlan_id   = get_current_vlan_id($vlan_name);
-      $where{$resol_arp{ipv4_address}} = find_all_switch_port($resol_arp{mac_address},$vlan_id); # retrouve les emplacements des routeurs
+      $where{$resol_arp{'ipv4_address'}} = find_all_switch_port($resol_arp{'mac_address'},$vlan_id); # retrouve les emplacements des routeurs
       }
 
@@ -2474,6 +2474,6 @@
          next ALL_SWITCH_CONNECTED if $switch->{port} eq '0';
 
-         $db_switch_output_port{$switch->{hostname}} = $switch->{port_hr};
-         print "VERBOSE_2: output port $switch->{hostname} : $switch->{port_hr}\n" if $verbose;
+         $db_switch_output_port{$switch->{'hostname'}} = $switch->{'port_hr'};
+         print "VERBOSE_2: output port $switch->{'hostname'} : $switch->{'port_hr'}\n" if $verbose;
          }
       }
@@ -2484,5 +2484,5 @@
    my @list_switch_ipv4 = ();
    for my $sw (@SWITCH_LIST) {
-      push @list_all_switch, $sw->{hostname};
+      push @list_all_switch, $sw->{'hostname'};
       }
 
@@ -2495,36 +2495,36 @@
          my $fake_ip = $SWITCH_DB{$one_switch}{'fake-ip'};
          fast_ping($fake_ip);
-         print "WARNING: fake ip on switch $one_switch -> $fake_ip / $resol_arp{ipv4_address}\n" if $verbose;
+         print "WARNING: fake ip on switch $one_switch -> $fake_ip / $resol_arp{'ipv4_address'}\n" if $verbose;
          my %resol_arp_alt = resolve_ip_arp_host($fake_ip, q{*}, q{low}); # arp resolution
-         if ($resol_arp_alt{mac_address} ne 'unknow') {
-            $resol_arp{mac_address}   = $resol_arp_alt{mac_address};
-            $resol_arp{interface}     = $resol_arp_alt{interface};
-            $resol_arp{ipv4_address} .= '*';
+         if ($resol_arp_alt{'mac_address'} ne 'unknow') {
+            $resol_arp{'mac_address'}   = $resol_arp_alt{'mac_address'};
+            $resol_arp{'interface'}     = $resol_arp_alt{'interface'};
+            $resol_arp{'ipv4_address'} .= '*';
             # Force a MAC trace on switch
-            system "arping -c 1 -w 1 -rR -i $resol_arp_alt{interface} $fake_ip > /dev/null 2>&1";
+            system "arping -c 1 -w 1 -rR -i $resol_arp_alt{'interface'} $fake_ip > /dev/null 2>&1";
             }
          }
       print "Info: switch loop $one_switch\n" if $verbose;
-      next ALL_SWITCH if $resol_arp{mac_address} eq 'unknow';
-
-      push @list_switch_ipv4, $resol_arp{ipv4_address};
-
-      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{interface});
+      next ALL_SWITCH if $resol_arp{'mac_address'} eq 'unknow';
+
+      push @list_switch_ipv4, $resol_arp{'ipv4_address'};
+
+      my $vlan_name = get_current_vlan_name_for_interface($resol_arp{'interface'});
       my $vlan_id   = get_current_vlan_id($vlan_name);
-      $where{$resol_arp{ipv4_address}} = find_all_switch_port($resol_arp{mac_address},$vlan_id); # find port on all switch
+      $where{$resol_arp{'ipv4_address'}} = find_all_switch_port($resol_arp{'mac_address'},$vlan_id); # find port on all switch
 
       if ($verbose) {
-         print "VERBOSE_3: $one_switch $resol_arp{ipv4_address} $resol_arp{mac_address}\n";
+         print "VERBOSE_3: $one_switch $resol_arp{'ipv4_address'} $resol_arp{'mac_address'}\n";
          print "VERBOSE_3: $one_switch --- ",
-            join(' + ', keys %{$where{$resol_arp{ipv4_address}}}),
+            join(' + ', keys %{$where{$resol_arp{'ipv4_address'}}}),
             "\n";
          }
 
-      $db_switch_ip_hostnamefq{$resol_arp{ipv4_address}} = $resol_arp{hostname_fq};
-      print "VERBOSE_4: db_switch_ip_hostnamefq $resol_arp{ipv4_address} -> $resol_arp{hostname_fq}\n" if $verbose;
-
-      $SWITCH_DB{$one_switch}->{ipv4_address} = $resol_arp{ipv4_address};
-      $SWITCH_DB{$one_switch}->{mac_address}  = $resol_arp{mac_address};
-      $SWITCH_DB{$one_switch}->{timestamp}    = $timestamp;
+      $db_switch_ip_hostnamefq{$resol_arp{'ipv4_address'}} = $resol_arp{'hostname_fq'};
+      print "VERBOSE_4: db_switch_ip_hostnamefq $resol_arp{'ipv4_address'} -> $resol_arp{'hostname_fq'}\n" if $verbose;
+
+      $SWITCH_DB{$one_switch}->{'ipv4_address'} = $resol_arp{'ipv4_address'};
+      $SWITCH_DB{$one_switch}->{'mac_address'}  = $resol_arp{'mac_address'};
+      $SWITCH_DB{$one_switch}->{'timestamp'}    = $timestamp;
       }
 
@@ -2542,12 +2542,12 @@
 
          my $switch = $where{$ip}->{$switch_detected};
-         print "VERBOSE_6: $db_switch_ip_hostnamefq{$ip} -> $switch->{hostname} : $switch->{port_hr}\n" if $verbose;
+         print "VERBOSE_6: $db_switch_ip_hostnamefq{$ip} -> $switch->{'hostname'} : $switch->{'port_hr'}\n" if $verbose;
 
          next if $switch->{port}     eq '0';
-         next if $switch->{port_hr}  eq $db_switch_output_port{$switch->{hostname}};
-         next if $switch->{hostname} eq $db_switch_ip_hostnamefq{$ip}; # $computerdb->{$ip}{hostname};
+         next if $switch->{'port_hr'}  eq $db_switch_output_port{$switch->{'hostname'}};
+         next if $switch->{'hostname'} eq $db_switch_ip_hostnamefq{$ip}; # $computerdb->{$ip}{'hostname'};
 
          $db_switch_link_with{ $db_switch_ip_hostnamefq{$ip} } ||= {};
-         $db_switch_link_with{ $db_switch_ip_hostnamefq{$ip} }->{ $switch->{hostname} } = $switch->{port_hr};
+         $db_switch_link_with{ $db_switch_ip_hostnamefq{$ip} }->{ $switch->{'hostname'} } = $switch->{'port_hr'};
          print "VERBOSE_7: +++++\n" if $verbose;
          }
@@ -2622,5 +2622,5 @@
    for my $sw (sort keys %db_switch_output_port) {
       if (exists $db_switch_parent{$sw}) {
-         printf "%-28s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port_hr}, $db_switch_parent{$sw}->{'switch'};
+         printf "%-28s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{'port_hr'}, $db_switch_parent{$sw}->{'switch'};
          }
       else {
@@ -2685,7 +2685,7 @@
    my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE");
 
-   my %db_switch_output_port       = %{$switch_connection->{output_port}};
-   my %db_switch_parent            = %{$switch_connection->{parent}};
-   my %db_switch_connected_on_port = %{$switch_connection->{connected_on_port}};
+   my %db_switch_output_port       = %{$switch_connection->{'output_port'}};
+   my %db_switch_parent            = %{$switch_connection->{'parent'}};
+   my %db_switch_connected_on_port = %{$switch_connection->{'connected_on_port'}};
 
    print "Switch output port and parent port connection\n";
@@ -2695,5 +2695,5 @@
          $arrow ='==>' if $db_switch_output_port{$sw} =~ m/^(Trk|Br|Po)/;
       if (exists $db_switch_parent{$sw}) {
-         printf "%-28s %8s %3s %-8s %-25s\n", $sw, $db_switch_output_port{$sw}, $arrow, $db_switch_parent{$sw}->{port_hr}, $db_switch_parent{$sw}->{'switch'};
+         printf "%-28s %8s %3s %-8s %-25s\n", $sw, $db_switch_output_port{$sw}, $arrow, $db_switch_parent{$sw}->{'port_hr'}, $db_switch_parent{$sw}->{'switch'};
          }
       else {
@@ -2726,17 +2726,17 @@
    my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE");
 
-   my %db_switch_output_port       = %{$switch_connection->{output_port}};
-   my %db_switch_parent            = %{$switch_connection->{parent}};
-   my %db_switch_connected_on_port = %{$switch_connection->{connected_on_port}};
-   my %db_switch_link_with         = %{$switch_connection->{link_with}};
-   my %db_switch_global            = %{$switch_connection->{switch_db}};
-   my $timestamp                   = $switch_connection->{'timestamp'};
+   my %db_switch_output_port       = %{$switch_connection->{'output_port'}};
+   my %db_switch_parent            = %{$switch_connection->{'parent'}};
+   my %db_switch_connected_on_port = %{$switch_connection->{'connected_on_port'}};
+   my %db_switch_link_with         = %{$switch_connection->{'link_with'}};
+   my %db_switch_global            = %{$switch_connection->{'switch_db'}};
+   my $timestamp                   =   $switch_connection->{'timestamp'};
 
    my %db_building= ();
    for my $sw (@SWITCH_LIST) {
-      my ($building, $location) = split m/ \/ /xms, $sw->{location}, 2;
+      my ($building, $location) = split m/ \/ /xms, $sw->{'location'}, 2;
       $db_building{$building} ||= {};
       $db_building{$building}->{$location} ||= {};
-      $db_building{$building}->{$location}{ $sw->{hostname} } = 'y';
+      $db_building{$building}->{$location}{ $sw->{'hostname'} } = 'y';
       }
 
