Index: /trunk/klask
===================================================================
--- /trunk/klask	(revision 369)
+++ /trunk/klask	(revision 370)
@@ -53,7 +53,7 @@
 
    # 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;
+   $session{-port}    = $sw->{'snmpport'} || $DEFAULT{'snmpport'} || 161;
    if (exists $sw->{'version'} and $sw->{'version'} eq '3') {
       $session{-username} = $sw->{'username'} || 'snmpadmin';
@@ -323,8 +323,8 @@
    # 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'}";
-#   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);
-#      }
+   #   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);
+   #      }
    if ($ret{'mac_address'} eq 'unknow') {
       # Last chance to have the mac_address
@@ -420,6 +420,6 @@
 
       $sw->{'description'} = $result->{$OID_NUMBER{'sysName'}} || $sw->{'hostname'};
-      $sw->{'model'} = get_switch_model($result->{$OID_NUMBER{'sysDescription'}});
-      $sw->{'revision'} = get_switch_revision($result->{$OID_NUMBER{'sysDescription'}});
+      $sw->{'model'}       = get_switch_model($result->{$OID_NUMBER{'sysDescription'}});
+      $sw->{'revision'}    = get_switch_revision($result->{$OID_NUMBER{'sysDescription'}});
       printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{'description'}, $sw->{'model'}.'('.$sw->{'revision'}.')' if $verbose;
 
@@ -459,5 +459,5 @@
       );
    my @chars = split m//xms, $car;
-   return $table{$chars[-2]}*16 + $table{$chars[-1]};
+   return $table{$chars[-2]} * 16 + $table{$chars[-1]};
    }
 
@@ -475,5 +475,5 @@
       }
 
-   return join q{:}, map { substr( uc("00$_"), -2) } split m/ [:-] /xms, $mac_address;
+   return join q{:}, map {substr(uc("00$_"), -2)} split m/ [:-] /xms, $mac_address;
    }
 
@@ -540,5 +540,5 @@
 sub fqdn_html_breakable {
    my $ref_fqdn = \($_[0]);
-   
+
    # Add HTML <wbr> before every . to permit line break
    $$ref_fqdn =~ s{\.}{.<wbr />}g;
@@ -550,11 +550,11 @@
    my $mac_address     = shift;
    my $switch_proposal = shift || q{};
-   my $vlan_id = shift || 0;
+   my $vlan_id         = shift || 0;
 
    my %ret;
    $ret{'switch_description'} = 'unknow';
-   $ret{'switch_port_id'} = '0';
-
-   return %ret if $mac_address eq 'unknow';;
+   $ret{'switch_port_id'}     = '0';
+
+   return %ret if $mac_address eq 'unknow';
 
    my @switch_search = @SWITCH_LIST;
@@ -568,9 +568,9 @@
 
    my $oid_search_port1 = $OID_NUMBER{'searchPort1'} . mac_address_hex2dec($mac_address);
-   my $oid_search_port2 = $OID_NUMBER{'searchPort2'} .'.'. $vlan_id . mac_address_hex2dec($mac_address);
+   my $oid_search_port2 = $OID_NUMBER{'searchPort2'} . '.' . $vlan_id . mac_address_hex2dec($mac_address);
 
    LOOP_ON_SWITCH:
    for my $sw (@switch_search) {
-      my ($session, $error) = Net::SNMP->session( %{$sw->{'snmp_param_session'}} );
+      my ($session, $error) = Net::SNMP->session(%{$sw->{'snmp_param_session'}});
       print "$error \n" if $error;
 
@@ -585,5 +585,5 @@
          }
 
-      if (not (defined $result and $result->{$oid_search_port1} ne 'noSuchInstance')) {
+      if (not(defined $result and $result->{$oid_search_port1} ne 'noSuchInstance')) {
          $session->close;
          next LOOP_ON_SWITCH;
@@ -629,5 +629,5 @@
 
    my $oid_search_port1 = $OID_NUMBER{'searchPort1'} . mac_address_hex2dec($mac_address);
-   my $oid_search_port2 = $OID_NUMBER{'searchPort2'} .'.'. $vlan_id . mac_address_hex2dec($mac_address);
+   my $oid_search_port2 = $OID_NUMBER{'searchPort2'} . '.' . $vlan_id . mac_address_hex2dec($mac_address);
    LOOP_ON_ALL_SWITCH:
    for my $sw (@SWITCH_LIST) {
@@ -653,5 +653,5 @@
             if ($swport_hr eq $portignore) {
                $session->close;
-               next LOOP_ON_ALL_SWITCH
+               next LOOP_ON_ALL_SWITCH;
                }
             }
@@ -715,5 +715,5 @@
 
    for my $net (@vlan_name) {
-      my @line  = @{$KLASK_CFG->{'network'}{$net}{'ip-subnet'}};
+      my @line = @{$KLASK_CFG->{'network'}{$net}{'ip-subnet'}};
       for my $cmd (@line) {
          for my $method (keys %{$cmd}) {
@@ -729,5 +729,5 @@
       for my $ip (@{$net}) {
          $ip =~ s{ /32 }{}xms;
-         push @res,  $ip;
+         push @res, $ip;
          }
       }
@@ -752,5 +752,5 @@
 #---------------------------------------------------------------
 sub normalize_port_human_readable {
-   my $sw_port_hr  = shift;
+   my $sw_port_hr = shift;
 
    # Manufacturer abbreviation
@@ -786,5 +786,5 @@
    # First get the index, second get the name (port_hr)
 
-   my $oid_search_ix = $OID_NUMBER{'ifIndex'} .'.'. $swport_id;
+   my $oid_search_ix = $OID_NUMBER{'ifIndex'} . '.' . $swport_id;
    my $result_ix = $snmp_session->get_request(
       -varbindlist => [$oid_search_ix]
@@ -811,9 +811,9 @@
    if ($swport_hr =~ m/^(Trk|Br|Po)/) {
       my $oid_search_index = $OID_NUMBER{'ifAggregator'}; # base OID
-      my @args = ( -varbindlist =>  [$oid_search_index]);
+      my @args = (-varbindlist => [$oid_search_index]);
       LOOP_ON_OID_PORT:
-      while ( defined $snmp_session->get_next_request(@args) ) {
+      while (defined $snmp_session->get_next_request(@args)) {
          my ($oid_current) = $snmp_session->var_bind_names;
-         last LOOP_ON_OID_PORT if  not Net::SNMP::oid_base_match($oid_search_index, $oid_current);
+         last LOOP_ON_OID_PORT if not Net::SNMP::oid_base_match($oid_search_index, $oid_current);
 
          # IEEE8023-LAG-MIB::dot3adAggPortSelectedAggID.28 = INTEGER: 337
@@ -849,9 +849,9 @@
 
    my $oid_search_ix = $OID_NUMBER{'ifIndex'}; # base OID
-   my @args = ( -varbindlist =>  [$oid_search_ix]);
+   my @args = (-varbindlist => [$oid_search_ix]);
    LOOP_ON_OID_PORT:
-   while ( defined $snmp_session->get_next_request(@args) ) {
+   while (defined $snmp_session->get_next_request(@args)) {
       my ($oid_current) = $snmp_session->var_bind_names;
-      last LOOP_ON_OID_PORT if  not Net::SNMP::oid_base_match($oid_search_ix, $oid_current);
+      last LOOP_ON_OID_PORT if not Net::SNMP::oid_base_match($oid_search_ix, $oid_current);
 
       my $port_ifIndex = $snmp_session->var_bind_list->{$oid_current};
@@ -862,5 +862,5 @@
       @args = (-varbindlist => [$oid_current]);
 
-      my $oid_search_ifName = $OID_NUMBER{'ifName'} .'.'. $port_ifIndex;
+      my $oid_search_ifName = $OID_NUMBER{'ifName'} . '.' . $port_ifIndex;
       my $result = $snmp_session->get_request(-varbindlist => [$oid_search_ifName]);
       next LOOP_ON_OID_PORT if not defined $result;
@@ -887,7 +887,7 @@
 
    my $oid_search_index = $OID_NUMBER{'vlanName'}; # base OID
-   my @args = ( -varbindlist =>  [$oid_search_index]);
+   my @args = (-varbindlist => [$oid_search_index]);
    LOOP_ON_VLAN:
-   while ( defined $snmp_session->get_next_request(@args) ) {
+   while (defined $snmp_session->get_next_request(@args)) {
       my ($oid_current) = $snmp_session->var_bind_names;
       last LOOP_ON_VLAN if not Net::SNMP::oid_base_match($oid_search_index, $oid_current);
@@ -950,5 +950,5 @@
       @_);
 
-   init_switch_names('yes');    #nomme les switchs
+   init_switch_names('yes'); # nomme les switchs
    print "\n";
 
@@ -958,5 +958,5 @@
 
    DETECT_ALL_ROUTER:
-   for my $one_router ( get_list_main_router(get_list_network()) ) {
+   for my $one_router (get_list_main_router(get_list_network())) {
       print "Info: router loop $one_router\n" if $args{'verbose'};
       my %resol_arp = resolve_ip_arp_host($one_router, q{*}, q{low}); # resolution arp
@@ -976,5 +976,5 @@
 
       ALL_SWITCH_CONNECTED:
-      for my $switch_detected ( keys %{$where{$ip_router}} ) {
+      for my $switch_detected (keys %{$where{$ip_router}}) {
 
          my $switch = $where{$ip_router}->{$switch_detected};
@@ -989,5 +989,5 @@
    my %db_switch_link_with = ();
 
-   my @list_all_switch = ();
+   my @list_all_switch  = ();
    my @list_switch_ipv4 = ();
    for my $sw (@SWITCH_LIST) {
@@ -1006,6 +1006,6 @@
          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{'mac_address'} = $resol_arp_alt{'mac_address'};
+            $resol_arp{'interface'}   = $resol_arp_alt{'interface'};
             $resol_arp{'ipv4_address'} .= '*';
             # Force a MAC trace on switch
@@ -1040,13 +1040,13 @@
    ALL_SWITCH_IP_ADDRESS:
    for my $ip (@list_switch_ipv4) {
-#   for my $ip (Net::Netmask::sort_by_ip_address(@list_switch_ipv4)) {
+      #   for my $ip (Net::Netmask::sort_by_ip_address(@list_switch_ipv4)) {
 
       print "VERBOSE_5: loop on $db_switch_ip_hostnamefq{$ip}\n" if $args{'verbose'};
 
       next ALL_SWITCH_IP_ADDRESS if not exists $where{$ip};
-#      next ALL_SWITCH_IP_ADDRESS if not exists $SWITCH_PORT_COUNT{ $db_switch_ip_hostnamefq{$ip} };
+      #      next ALL_SWITCH_IP_ADDRESS if not exists $SWITCH_PORT_COUNT{ $db_switch_ip_hostnamefq{$ip} };
 
       DETECTED_SWITCH:
-      for my $switch_detected ( keys %{$where{$ip}} ) {
+      for my $switch_detected (keys %{$where{$ip}}) {
 
          my $switch = $where{$ip}->{$switch_detected};
@@ -1057,6 +1057,6 @@
          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}} ||= {};
+         $db_switch_link_with{$db_switch_ip_hostnamefq{$ip}}->{$switch->{'hostname'}} = $switch->{'port_hr'};
          print "VERBOSE_7: +++++\n" if $args{'verbose'};
          }
@@ -1064,7 +1064,7 @@
       }
 
-   my %db_switch_connected_on_port = ();
+   my %db_switch_connected_on_port          = ();
    my $maybe_more_than_one_switch_connected = 'yes';
-   my $cloop = 0;
+   my $cloop                                = 0;
 
    while ($maybe_more_than_one_switch_connected eq 'yes' and $cloop < 100) {
@@ -1081,5 +1081,5 @@
          }
 
-      $maybe_more_than_one_switch_connected  = 'no';
+      $maybe_more_than_one_switch_connected = 'no';
 
       SWITCH_AND_PORT:
@@ -1092,5 +1092,5 @@
          my ($sw_connect, $port_connect) = split m/ $SEP_SWITCH_PORT /xms, $swport, 2;
          my @sw_on_same_port = keys %{$db_switch_connected_on_port{$swport}};
-         print "VERBOSE_10: $swport -- ".$#sw_on_same_port." -- @sw_on_same_port\n" if $args{'verbose'};
+         print "VERBOSE_10: $swport -- " . $#sw_on_same_port . " -- @sw_on_same_port\n" if $args{'verbose'};
 
          CONNECTED:
@@ -1113,5 +1113,5 @@
       }
 
-   my %db_switch_parent =();
+   my %db_switch_parent = ();
 
    for my $sw (keys %db_switch_link_with) {
@@ -1174,5 +1174,5 @@
 sub cmd_help {
 
-print <<'END';
+   print <<'END';
 klask - port and search manager for switches, map management
 
@@ -1213,5 +1213,5 @@
 sub cmd_version {
 
-print <<'END';
+   print <<'END';
 klask - port and search manager for switches, map management
 Copyright (C) 2005-2017 Gabriel Moreau <Gabriel.Moreau(A)univ-grenoble-alpes.fr>
@@ -1228,13 +1228,13 @@
    my @computer = @_;
 
-   init_switch_names();    #nomme les switchs
+   init_switch_names(); # nomme les switchs
    fast_ping(@computer);
 
    LOOP_ON_COMPUTER:
    for my $clientname (@computer) {
-      my %resol_arp = resolve_ip_arp_host($clientname);          #resolution arp
+      my %resol_arp = resolve_ip_arp_host($clientname); # resolution arp
       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
+      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';
@@ -1245,5 +1245,5 @@
          $resol_arp{'hostname_fq'},
          $resol_arp{'ipv4_address'},
-         $resol_arp{'mac_address'}."\n";
+         $resol_arp{'mac_address'} . "\n";
       }
    return;
@@ -1252,5 +1252,5 @@
 #---------------------------------------------------------------
 sub cmd_searchdb {
-   my @ARGV  = @_;
+   my @ARGV = @_;
 
    my $kind;
@@ -1261,6 +1261,6 @@
 
    my %possible_search = (
-      host  => \&cmd_searchdb_host,
-      mac   => \&cmd_searchdb_mac,
+      host => \&cmd_searchdb_host,
+      mac  => \&cmd_searchdb_mac,
       );
 
@@ -1271,5 +1271,4 @@
    }
 
-
 #---------------------------------------------------------------
 sub cmd_searchdb_host {
@@ -1281,10 +1280,10 @@
    LOOP_ON_COMPUTER:
    for my $clientname (@computer) {
-      my %resol_arp = resolve_ip_arp_host($clientname);      #resolution arp
-      my $ip = $resol_arp{'ipv4_address'};
+      my %resol_arp = resolve_ip_arp_host($clientname); # resolution arp
+      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++;
@@ -1304,5 +1303,5 @@
 #---------------------------------------------------------------
 sub cmd_searchdb_mac {
-   my @mac = map { normalize_mac_address($_) } @_;
+   my @mac = map {normalize_mac_address($_)} @_;
 
    my $computerdb = computerdb_load();
@@ -1314,5 +1313,5 @@
          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'};
+         my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime $computerdb->{$ip}{'timestamp'};
          $year += 1900;
          $mon++;
@@ -1348,10 +1347,10 @@
 
    my @network = @ARGV;
-      @network = get_list_network() if not @network;
+   @network = get_list_network() if not @network;
 
    test_switchdb_environnement();
 
    my $computerdb = {};
-      $computerdb = computerdb_load() if -e "$KLASK_DB_FILE";
+   $computerdb = computerdb_load() if -e "$KLASK_DB_FILE";
    my $timestamp = time;
 
@@ -1361,9 +1360,9 @@
    my $number_of_computer = get_list_ip(@network); # + 1;
    my $size_of_database   = keys %{$computerdb};
-      $size_of_database   = 1 if $size_of_database == 0;
-   my $i = 0;
+   $size_of_database = 1 if $size_of_database == 0;
+   my $i                 = 0;
    my $detected_computer = 0;
 
-   init_switch_names('yes', $verb_description, $check_hostname, $check_location);    #nomme les switchs
+   init_switch_names('yes', $verb_description, $check_hostname, $check_location); # nomme les switchs
 
    {
@@ -1400,8 +1399,8 @@
    my %router_mac_ip = ();
    DETECT_ALL_ROUTER:
-#   for my $one_router ('194.254.66.254') {
-   for my $one_router ( get_list_main_router(@network) ) {
+   #   for my $one_router ('194.254.66.254') {
+   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'};
       }
 
@@ -1409,5 +1408,5 @@
    for my $current_net (@network) {
 
-      my @computer = get_list_ip($current_net);
+      my @computer          = get_list_ip($current_net);
       my $current_interface = get_current_interface($current_net);
 
@@ -1418,16 +1417,16 @@
          $i++;
 
-         my $total_percent = int (($i*100)/$number_of_computer);
+         my $total_percent = int(($i * 100) / $number_of_computer);
 
          my $localtime = time - $timestamp;
-         my ($sec,$min) = localtime $localtime;
+         my ($sec, $min) = localtime $localtime;
 
          my $time_elapse = 0;
-            $time_elapse = $localtime * ( 100 - $total_percent) / $total_percent if $total_percent != 0;
-         my ($sec_elapse,$min_elapse) = localtime $time_elapse;
-
-         printf "\rComputer scanned: %4i/%i (%2i%%)",  $i,                 $number_of_computer, $total_percent;
-         printf ', detected: %4i/%i (%2i%%)', $detected_computer, $size_of_database,   int(($detected_computer*100)/$size_of_database);
-         printf ' [Time: %02i:%02i / %02i:%02i]', int($localtime/60), $localtime % 60, int($time_elapse/60), $time_elapse % 60;
+         $time_elapse = $localtime * (100 - $total_percent) / $total_percent if $total_percent != 0;
+         my ($sec_elapse, $min_elapse) = localtime $time_elapse;
+
+         printf "\rComputer scanned: %4i/%i (%2i%%)", $i, $number_of_computer, $total_percent;
+         printf ', detected: %4i/%i (%2i%%)', $detected_computer, $size_of_database, int(($detected_computer * 100) / $size_of_database);
+         printf ' [Time: %02i:%02i / %02i:%02i]', int($localtime / 60), $localtime % 60, int($time_elapse / 60), $time_elapse % 60;
          printf ' %-8s %-14s', $current_interface, $one_computer;
 
@@ -1436,5 +1435,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;
@@ -1460,5 +1459,5 @@
          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:
@@ -1470,8 +1469,8 @@
 
          # do not have a mac address
-#         if ($resol_arp{'mac_address'} eq 'unknow') {
-#            $computer_not_detected{$one_computer} = $current_interface;
-#            next LOOP_ON_COMPUTER;
-#            }
+         #         if ($resol_arp{'mac_address'} eq 'unknow') {
+         #            $computer_not_detected{$one_computer} = $current_interface;
+         #            next LOOP_ON_COMPUTER;
+         #            }
 
          # detected on a switch
@@ -1513,5 +1512,5 @@
 
          # 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;
+         # 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;
 
@@ -1528,5 +1527,5 @@
 
    for my $one_computer (keys %computer_not_detected) {
-      my $current_net = $computer_not_detected{$one_computer};
+      my $current_net       = $computer_not_detected{$one_computer};
       my $current_interface = get_current_interface($current_net);
       system "arping -c 1 -w 1 -rR -i $current_interface $one_computer > /dev/null 2>&1" if get_current_scan_mode($current_net) eq 'active';
@@ -1546,6 +1545,6 @@
    for my $one_computer (@computer) {
 
-      if ( $one_computer =~ m/^ $RE_IPv4_ADDRESS $/xms
-            and exists $computerdb->{$one_computer} ) {
+      if ($one_computer =~ m/^ $RE_IPv4_ADDRESS $/xms
+            and exists $computerdb->{$one_computer}) {
          delete $computerdb->{$one_computer};
          next;
@@ -1566,5 +1565,5 @@
 #---------------------------------------------------------------
 sub cmd_cleandb {
-   my @ARGV  = @_;
+   my @ARGV = @_;
 
    my $days_to_clean = 15;
@@ -1574,6 +1573,6 @@
 
    GetOptions(
-      'day|d=i'   => \$days_to_clean,
-      'verbose|v' => \$verbose,
+      'day|d=i'      => \$days_to_clean,
+      'verbose|v'    => \$verbose,
       'repair-dns|r' => \$repairdns,
       );
@@ -1582,5 +1581,5 @@
 
    my $computerdb = computerdb_load();
-   my $timestamp = time;
+   my $timestamp  = time;
 
    my $timestamp_barrier = 3600 * 24 * $days_to_clean;
@@ -1591,13 +1590,13 @@
    for my $vlan (shuffle @vlan_name) {
 
-      my @ip_list   = shuffle get_list_ip($vlan);
+      my @ip_list = shuffle get_list_ip($vlan);
 
       LOOP_ON_IP_ADDRESS:
       for my $ip (@ip_list) {
 
-         next LOOP_ON_IP_ADDRESS if
-            not exists $computerdb->{$ip};
-
-            #&& $computerdb->{$ip}{'timestamp'} > $timestamp_barrier;
+         next LOOP_ON_IP_ADDRESS
+            if not exists $computerdb->{$ip};
+
+         #&& $computerdb->{$ip}{'timestamp'} > $timestamp_barrier;
          my $ip_timestamp   = $computerdb->{$ip}{'timestamp'};
          my $ip_mac         = $computerdb->{$ip}{'mac_address'};
@@ -1643,5 +1642,5 @@
             }
 
-         if ( $ip_timestamp > $mactimedb{$ip_mac}->{'timestamp'}) {
+         if ($ip_timestamp > $mactimedb{$ip_mac}->{'timestamp'}) {
             $mactimedb{$ip_mac} = {
                ip          => $ip,
@@ -1670,5 +1669,5 @@
       }
 
-   if ( $database_has_changed ) {
+   if ($database_has_changed) {
       my $dirdb = $KLASK_DB_FILE;
          $dirdb =~ s{ / [^/]* $}{}xms;
@@ -1729,5 +1728,5 @@
 
       my $vlan = '';
-      $vlan = $computerdb->{$ip}{'network'}.'('.get_current_vlan_id($computerdb->{$ip}{'network'}).')' if $computerdb->{$ip}{'network'};
+      $vlan = $computerdb->{$ip}{'network'} . '(' . get_current_vlan_id($computerdb->{$ip}{'network'}).')' if $computerdb->{$ip}{'network'};
 
       my $arrow = '<---';
@@ -1886,5 +1885,5 @@
 
          my $vlan = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'network'};
-         $vlan .= ' ('.get_current_vlan_id($db_switch{$db_switch_parent{$sw}->{'switch'}}->{'network'}).')' if $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'network'};
+         $vlan .= ' (' . get_current_vlan_id($db_switch{$db_switch_parent{$sw}->{'switch'}}->{'network'}) . ')' if $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'network'};
 
          my $parent_port_hr = format_aggregator4html($db_switch_output_port{$sw});
@@ -3288,5 +3287,4 @@
    }
 
-
 ################################################################
 # documentation
