my $browse = $t->getOpenFile(-title => "Browse For A File!"); if ($browse) { $t->delete("1.0", "end"); $status->delete("1.0", "end"); if (!open(TARGET, "$browse")) { $info = "Error!"; $status->insert("end", "ERROR: Could not open $browse\n"); return; } $line_count = 1; $filename = $browse; my @ext = split(/\./, $filename); my $ext = "\." . $ext[1]; $info = "Loading file '$filename'..."; while () { #$t->insert("end", "$line_count "); $t->insert("end", $_); if ($ext eq ".pl") { if ($_ =~ /\#/) { my @comment = split(//, $_); my $i = 0; foreach my $comment (@comment) { my $range = length($_); if ($comment eq "#") { my $offset = "$line_count\.$i"; my $end = "$line_count\.$range"; $t->tagAdd("orange", $offset, $end); }else{ $i++; } } } } $line_count++; } }