]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
term2gui.pl: remove unnecessary variable
authorSimon Ruderich <simon@ruderich.org>
Fri, 21 Mar 2014 22:55:18 +0000 (23:55 +0100)
committerSimon Ruderich <simon@ruderich.org>
Fri, 21 Mar 2014 22:55:18 +0000 (23:55 +0100)
term2gui.pl

index c019326f8448117d49b07df7d04fc7ebc82ad0fb..6da84f48ec87297c8865cd886c07504c257af635 100755 (executable)
@@ -281,10 +281,10 @@ sub xterm2rgb {
 }
 
 
-while (my $line = <>) {
+while (<>)) {
     # Only handle lines with highlight commands.
-    if ($line =~ /^\s*\bhi(?:ghlight)?\b/) {
-        foreach my $setting ($line =~ m/\bcterm(?:fg|bg)?=\S+/g) {
+    if (/^\s*\bhi(?:ghlight)?\b/) {
+        foreach my $setting (m/\bcterm(?:fg|bg)?=\S+/g) {
             my ($name, $value) = split /=/, $setting;
 
             my $gui_name = $name;
@@ -300,14 +300,14 @@ while (my $line = <>) {
             }
 
             # Update existing value.
-            if ($line =~ /\b\Q$gui_name\E=/) {
-                $line =~ s/\Q$gui_name\E=\S+/$gui_name=$new_value/;
+            if (/\b\Q$gui_name\E=/) {
+                s/\Q$gui_name\E=\S+/$gui_name=$new_value/;
             # Append at the end of the line.
             } else {
-                $line =~ s/\n/ $gui_name=$new_value\n/;
+                s/\n/ $gui_name=$new_value\n/;
             }
         }
     }
 
-    print $line;
+    print;
 }