diff options
author | Thierry Vignaud <tv@mageia.org> | 2013-03-15 18:43:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2013-03-15 18:43:16 +0000 |
commit | 283aaba410e1dd136dcc7c68cb46d355072d8ab6 (patch) | |
tree | 6b09586524e640d6bd37c9e5adbd05724aa0aefc /bin | |
parent | 3992740ddadeaafa924976fee26b4f7c6c2412ea (diff) | |
download | drakguard-283aaba410e1dd136dcc7c68cb46d355072d8ab6.tar drakguard-283aaba410e1dd136dcc7c68cb46d355072d8ab6.tar.gz drakguard-283aaba410e1dd136dcc7c68cb46d355072d8ab6.tar.bz2 drakguard-283aaba410e1dd136dcc7c68cb46d355072d8ab6.tar.xz drakguard-283aaba410e1dd136dcc7c68cb46d355072d8ab6.zip |
perl_checker: don't use for without "my"ing the iteration variable
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/drakguard | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/drakguard b/bin/drakguard index c92f1be..4e8201e 100755 --- a/bin/drakguard +++ b/bin/drakguard @@ -675,24 +675,22 @@ sub apply_block_program() { } #code to make diff bettween vectors my (@intersection, @difference); - my $element; @intersection = @difference = (); my %count = (); - foreach $element (@original_list, @actual_list) { $count{$element}++ } - foreach $element (keys %count) { + foreach my $element (@original_list, @actual_list) { $count{$element}++ } + foreach my $element (keys %count) { push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element; } if (scalar(@difference)) { #keep the permissons save, make the way to do that - my $diff; - foreach $diff (@difference) { + foreach my $diff (@difference) { my @orig_file = cat_($perms_orig); my @progs_orig_file = grep { $_ && m/$diff/g } chomp_(cat_($perms_orig)); #test if program is in msec my @msec_program = grep { $_ && m/$diff/g } chomp_(cat_($msec_conf)); if (scalar(@progs_orig_file)) {#test if is to remove or to add acl #clean config file of the removed programs - foreach $element (@progs_orig_file) { + foreach my $element (@progs_orig_file) { my $val = $element; substInFile { s|$element.*\n||; |