#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow->new; my @colours = qw(red green blue yellow white); my @text = qw(L a b e l t e x t); $mw->Label(-textvariable => \$text[$_], -fg => $colours[rand @colours] )->pack(-side => 'left') for 0..scalar(@text)-1; MainLoop();