http://www.perlmonks.org?node_id=531023


in reply to Spatial Japh

If your terminal/putty/shell window stays colored after running this (as mine does, which is a little annoying :) and you're not familiar with shell escapes for colorizing foregrounds/backgrounds of terminal/putty/shell windows (as I wasn't), be sure to have on of these handy for resetting your colors to the way they were:

perl -e 'printf "\e[0%dm", 0'

:)

Update: D'oh! Yes of course. I was busy just replacing the line from the excellent explanation above:

printf "\e[$escape;%dm", int(rand 6) + 101 - 60 * ($is_windows || 0);

... with something that wouldn't leave my window a different color that I didn't even bother to shorten it beyond printf "\e[0%dm", 0. But seeing liverpole's comment below, I feel completely silly for not "golfing" it further.



--chargrill
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );

Replies are listed 'Best First'.
Re^2: Spatial Japh
by liverpole (Monsignor) on Feb 17, 2006 at 18:34 UTC
    A good point.

    You can make it even easier to remember by golfing it to:  perl -e 'print "\e[m"'


    @ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"