in reply to Re^11: Immediately writing the results of search-and-replace
in thread Immediately writing the results of search-and-replace
my ($old, $new, $reset) = map "\e[${_}m", 91, 92, 0;
Left-hand side: Three variables, $old, $new, $reset.
Right-hand side: A map expression iterating over the three values 91, 92, and 0. map evaluates the expression "\e[${_}m" for each of the three values, resulting in the list "\e[91m", "\e[92m", "\e[0m".
Finally, the three element RHS list is assigned to the LHS list of variables.
The values are ANSI terminal escape sequences for setting text attributes, see https://en.wikipedia.org/wiki/ANSI_escape_code#SGR. 91 selects bright red foreground, 92 selects bright green foreground, 0 resets back to defaults.
Alexander
|
|---|