#!/usr/bin/perl # # .bitchxrc: # # /alias rainbow exec -out ~/.BitchX/rainbow.pl # use Term::ANSIColor; select STDOUT; $string = ""; @stats = (); $char_counter = 0; @colors = ( "0", "4", "8", "9", "11", "12", "13"); foreach (@ARGV) { $item .= $_ . " "; } $item =~ s/\ *$//g; while ($char_counter < length($item)) { $fg += int(rand(2)); $fg = 0 if ($fg > $#colors); $string .= "\003"; $string .= sprintf("%02d", $colors[$fg]); $char = ((substr($item, $char_counter, 1))); $string .= (($char eq ",") ? ",," : $char); $string .= "\017"; $char_counter++; $fg++; } print "$string\n";