From f62e579af0c78a83c6a26889128b3eaf5bf1f21a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 15 Mar 2013 18:43:12 +0000 Subject: perl_checker: kill unused variables --- bin/drakguard | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/drakguard b/bin/drakguard index b4d0e7b..9420979 100755 --- a/bin/drakguard +++ b/bin/drakguard @@ -230,8 +230,6 @@ gtkadd($w->{window}, })), 0, gtknew('Button', text => N("Add"), clicked => sub { my $text = $entry->get_text; - my $exec; - my $args; $text =~ s,^[^:]+://,,g; #- strip protocol if ($url_list->{tab_title} eq N("Block programs")) { $text =~ s,(\W?)$,,g; #- remove unknown caracters @@ -244,9 +242,9 @@ gtkadd($w->{window}, $locale = lc($locale->{country}); my @system_name = grep { $_ && m/^GenericName(\[$locale\])?=(.*)\s*/g } chomp_(cat_($text)); foreach (@exec_line) { - ($exec, $text, $args) = /(^Exec=)(\w+)\s*(.*)/; + ($text) = /^Exec=(\w+)\s*/; if ($text eq "") { - ($exec, $text, $args) = /(^Exec=)(.*+)\s*(.*)/ } + ($text) = /^Exec=(.*+)\s*/ } } foreach my $b (@system_name) { $original_entry = $b; @@ -302,7 +300,7 @@ if (grep { $_ && !/acl/ } chomp_(cat_($fstab_file)) && grep { $_ && m/ext/ } cho if ($acl_active) { my @ext_lines = grep { $_ && m/ext/ } chomp_(cat_($fstab_file)); foreach my $line (@ext_lines) { - my ($id, $directory, $flag, $number) = $line =~ /^(.+)\s(.+)\s(ext(\w)\s(\w*))\s(.*)/ or next; + my ($flag) = $line =~ /^.+\s.+\s(ext(\w)\s(\w*))\s/ or next; $line =~ s/ext(\w)\s(\w*)\s/$flag,acl /g; subst_config_line($fstab_file, "$line\n"); #adds ,acl in the fstab file in the first run # remount filesystem with acl parameter @@ -556,14 +554,13 @@ sub subst_config_line { sub clean_config_line { my ($file, $line) = @_; my $key = first(split(' ', $line)); - my $done; substInFile { - $done = 1 if s|^\s*$key.*\n||; + s|^\s*$key.*\n||; } $file; } sub block_internet_dansguardian { - my ($file, $line) = @_; + my ($file) = @_; my $key = "#"; substInFile { s|^$key\*\*\s|**\n|; @@ -677,13 +674,12 @@ sub apply_block_program() { s/\s(.*)//; } #code to make diff bettween vectors - my (@union, @intersection, @difference); + my (@intersection, @difference); my $element; - @union = @intersection = @difference = (); + @intersection = @difference = (); my %count = (); foreach $element (@original_list, @actual_list) { $count{$element}++ } foreach $element (keys %count) { - # push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element; } if (scalar(@difference)) { -- cgit v1.2.1