aboutsummaryrefslogtreecommitdiffstats
path: root/translate_menu.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-08-02 04:35:24 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-08-02 04:35:24 +0000
commit475d5b279433dbf5b755a0b52bbdce7e1ed49ab0 (patch)
tree61ea28403f4f8f2fa7d69bab3f0694bbb92c5d1a /translate_menu.pl
parentf85d7cf0bb1d74ead24d0ed56574b8641714fbc7 (diff)
downloadspec-helper-475d5b279433dbf5b755a0b52bbdce7e1ed49ab0.tar
spec-helper-475d5b279433dbf5b755a0b52bbdce7e1ed49ab0.tar.gz
spec-helper-475d5b279433dbf5b755a0b52bbdce7e1ed49ab0.tar.bz2
spec-helper-475d5b279433dbf5b755a0b52bbdce7e1ed49ab0.tar.xz
spec-helper-475d5b279433dbf5b755a0b52bbdce7e1ed49ab0.zip
perl_checker cleanups
Diffstat (limited to 'translate_menu.pl')
-rwxr-xr-xtranslate_menu.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/translate_menu.pl b/translate_menu.pl
index c634e14..57845fb 100755
--- a/translate_menu.pl
+++ b/translate_menu.pl
@@ -9,7 +9,7 @@
# Purpose : change the menu sections
#---------------------------------------------------------------
-@nested = (["Configuration", "System/Configuration"],
+my @nested = (["Configuration", "System/Configuration"],
["Applications/Monitoring", "System/Monitoring"],
["Applications/Publishing", "Office/Publishing"],
@@ -36,7 +36,7 @@ sub translate {
my ($str) = @_;
foreach my $t (@nested) {
- if ($str =~ /(.*)$t->[0](.*)/ and not ($str =~ /$t->[1]/) ) {
+ if ($str =~ /(.*)$t->[0](.*)/ && $str !~ /$t->[1]/) {
print "$str => $1$t->[1]$2\n";
return "$1$t->[1]$2";
}
@@ -46,16 +46,16 @@ sub translate {
# process each file passed on cli:
foreach my $file (@ARGV) {
- open (my $FILE, "<$file");
+ open(my $FILE, "<$file");
my @lines = <$FILE>;
close($FILE);
- open ($FILE, ">$file");
- for my $l (@lines) {
+ open($FILE, ">$file");
+ foreach my $l (@lines) {
chomp($l);
- if (( $l =~ /(.*section=)"([^"]+)"(\s+.*)/ ) or ( $l =~ /(.*section=)([^"].+?)((\s|\\)+.*)/ )) {
+ if ($l =~ /(.*section=)"([^"]+)"(\s+.*)/ || $l =~ /(.*section=)([^"].+?)((\s|\\)+.*)/) {
my ($beg, $section, $end) = ($1, $2, $3);
$section = translate($section);
- $l = "$beg\"$section\"$end";
+ $l = qq($beg"$section"$end);
}
print $FILE "$l\n";
}