From 89ece2527c215986891e661debb064d7dd248005 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 21 Mar 2014 23:55:18 +0100 Subject: [PATCH] term2gui.pl: remove unnecessary variable --- term2gui.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/term2gui.pl b/term2gui.pl index c019326..6da84f4 100755 --- a/term2gui.pl +++ b/term2gui.pl @@ -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; } -- 2.45.2