Index: trunk/klask
===================================================================
--- trunk/klask	(revision 57)
+++ trunk/klask	(revision 58)
@@ -176,5 +176,5 @@
    # my $cmd = "grep  -e '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/arp.dat | sort +2rn | head -1";
    # my $cmd = "grep  -he '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/*.dat | sort +2rn | head -1";
-   my $cmd = "grep  -he '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
+   my $cmd = "grep  -he '" . '\b' . "$param_ip_or_host" . '\b' . "' /var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
    my $cmd_arpwatch = shell_command $cmd;
    my ($arp, $ip, $timestamp, $host) = split m/ \s+ /xms, $cmd_arpwatch;
@@ -298,7 +298,7 @@
    return '00' if $car eq '00UNKNOW';
    my %table = (
-      "0"=>"0",  "1"=>"1",  "2"=>"2",  "3"=>"3",  "4"=>"4",
-      "5"=>"5",  "6"=>"6",  "7"=>"7",  "8"=>"8",  "9"=>"9",
-      "A"=>"10", "B"=>"11", "C"=>"12", "D"=>"13", "E"=>"14", "F"=>"15"
+      '0'=>'0',  '1'=>'1',  '2'=>'2',  '3'=>'3',  '4'=>'4',
+      '5'=>'5',  '6'=>'6',  '7'=>'7',  '8'=>'8',  '9'=>'9',
+      'A'=>'10', 'B'=>'11', 'C'=>'12', 'D'=>'13', 'E'=>'14', 'F'=>'15'
       );
    my @chars = split m//xms, $car;
@@ -327,6 +327,6 @@
 
    my %ret;
-   $ret{switch_description} = "unknow";
-   $ret{switch_port} = "0";
+   $ret{switch_description} = 'unknow';
+   $ret{switch_port} = '0';
 
    return %ret if $arp eq 'unknow';;
@@ -398,5 +398,5 @@
       }
 
-   my $research = "1.3.6.1.2.1.17.4.3.1.2".arp_hex_to_dec($arp);
+   my $research = '1.3.6.1.2.1.17.4.3.1.2' . arp_hex_to_dec($arp);
    LOOP_ON_ALL_SWITCH:
    for my $sw (@SWITCH) {
@@ -550,5 +550,5 @@
       my %resol_arp = resolve_ip_arp_host($clientname);          #resolution arp
       my %where     = find_switch_port($resol_arp{mac_address}); #retrouve l'emplacement
-      printf "%-22s %2i %-30s %-15s %18s", $where{switch_description}, $where{switch_port}, $resol_arp{hostname_fq}, $resol_arp{ipv4_address}, $resol_arp{mac_address}."\n"
+      printf '%-22s %2i %-30s %-15s %18s', $where{switch_description}, $where{switch_port}, $resol_arp{hostname_fq}, $resol_arp{ipv4_address}, $resol_arp{mac_address}."\n"
          unless $where{switch_description} eq 'unknow' and $resol_arp{hostname_fq} eq 'unknow' and $resol_arp{mac_address} eq 'unknow';
       }
@@ -572,5 +572,5 @@
       $year += 1900;
       $mon++;
-      my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min;
+      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
 
       printf "%-22s %2s %-30s %-15s %-18s %s\n",
@@ -656,8 +656,8 @@
          printf "\rComputer scanned: %4i/%i (%2i%%)",  $i,                 $number_of_computer, $total_percent;
 #         printf ", Computer detected: %4i/%i (%2i%%)", $detected_computer, $size_of_database,   int(($detected_computer*100)/$size_of_database);
-         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 "  [%02i:%02i/%02i:%02i]", int($localtime/60), $localtime % 60, int($time_elapse/60), $time_elapse % 60;
-         printf " %-14s", $one_computer;
+         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 '  [%02i:%02i/%02i:%02i]', int($localtime/60), $localtime % 60, int($time_elapse/60), $time_elapse % 60;
+         printf ' %-14s', $one_computer;
 
          my %resol_arp = resolve_ip_arp_host($one_computer,$current_interface);
@@ -823,5 +823,5 @@
       $year += 1900;
       $mon++;
-      my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min;
+      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
 
       printf "%-25s  %2s  <-------  %-30s %-15s %-18s %s\n",
@@ -893,5 +893,5 @@
       $year += 1900;
       $mon++;
-      my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min;
+      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
 
 #      $odd_or_even++;
@@ -901,9 +901,9 @@
       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};
-
-      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};
+      my $switch_hostname_sort = sprintf '%s %3s' ,$switch_hostname, $computerdb->{$ip}{switch_port};
+
+      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;
@@ -932,5 +932,5 @@
    for my $sw (sort keys %db_switch_output_port) {
 
-      my $switch_hostname_sort = sprintf "%s %3s" ,$sw, $db_switch_output_port{$sw};
+      my $switch_hostname_sort = sprintf '%s %3s' ,$sw, $db_switch_output_port{$sw};
 
       $typerow = $typerow eq 'even' ? 'odd' : 'even';
@@ -945,11 +945,11 @@
       $year += 1900;
       $mon++;
-      my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min;
-
-      my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /xms, $ipv4_address);
-
-      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};
+      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
+
+      my $ip_sort = sprintf '%03i%03i%03i%03i', split( m/ \. /xms, $ipv4_address);
+
+      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};
 
       print <<"END_HTML";
@@ -984,5 +984,5 @@
       for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
 
-         my $switch_hostname_sort = sprintf "%s %3s" ,$sw_connect, $port_connect;
+         my $switch_hostname_sort = sprintf '%s %3s' ,$sw_connect, $port_connect;
 
       my $mac_address = $db_switch{$sw}->{mac_address};
@@ -993,9 +993,9 @@
       $year += 1900;
       $mon++;
-      my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min;
-
-      my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /xms, $ipv4_address);
-
-      my $mac_sort = sprintf "%04i-%s", 9999, $mac_address;
+      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year,$mon,$mday,$hour,$min;
+
+      my $ip_sort = sprintf '%03i%03i%03i%03i', split( m/ \. /xms, $ipv4_address);
+
+      my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
 
       $typerow = $typerow eq 'even' ? 'odd' : 'even';
@@ -1003,5 +1003,5 @@
          if (exists $db_switch_output_port{$sw}) {
 
-            my ( $host_short ) = sprintf "%s %3s" , split( m/\./xms, $sw, 1), $db_switch_output_port{$sw};
+            my ( $host_short ) = sprintf '%s %3s' , split( m/\./xms, $sw, 1), $db_switch_output_port{$sw};
 
             print <<"END_HTML";
@@ -1112,5 +1112,5 @@
       }
 
-   my $research = "1.3.6.1.2.1.17.4.3.1.2".arp_hex_to_dec($mac_address);
+   my $research = '1.3.6.1.2.1.17.4.3.1.2' . arp_hex_to_dec($mac_address);
    print "Klask search OID $research on switch $switch_name\n";
 
