From: Simon Ruderich Date: Fri, 21 Mar 2014 22:55:18 +0000 (+0100) Subject: term2gui.pl: remove unnecessary variable X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=89ece2527c215986891e661debb064d7dd248005;p=config%2Fdotfiles.git term2gui.pl: remove unnecessary variable --- 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; }