#!/usr/bin/perl use strict; use warnings; use Term::ANSIScreen qw/:color :cursor :screen/; use Term::ReadKey; setmode 3; cls; my @colors = ('black on green', 'black on red', 'black on blue', 'black on yellow', 'black on cyan', 'black on magenta', 'black on white'); # Loop to continuously blink the lights but terminate when a key is pressed while (not defined (my $key = ReadKey(-1))) { locate int(rand(23)), int(rand(79)); print colored (" ", "reverse " . $colors[int(rand(7))]); }