in reply to Perl tk how to change text widget font colour on multiple lines

You need to make your tags before you do your insert, then specify the tag for each line as you insert it.
# while (<FH>) { $right_frame->insert("end", $_); } # should be something like this while (<FH>) { $right_frame->insert("end", $_, $tag); }
Here is a complete simple example.
#!/usr/bin/perl use warnings; use strict; use Tk; open (FH,"<$0") or warn "$!\n"; my @lines = <FH>; close FH; my $mw = MainWindow->new(-title=>'Colored Text'); $mw->geometry(($mw->screenwidth-10) . 'x' . ($mw->screenheight-10) . '+0+20'); $mw->fontCreate('big', -family=>'arial', -weight=>'bold', -size => 25 ); my $text = $mw->Scrolled("Text", -scrollbars => 'osw', -background => 'white', -font =>'big', -wrap => 'none', )->pack; $text->tagConfigure('greyline', -background => 'grey95'); my $toggle = -1; for (@lines) { my $greyline; if( $toggle == 1 ){ my $greyline = '' } else { $greyline = 'greyline' } $text->insert('end',"$_",$greyline); $toggle *= -1; } MainLoop;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh