Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Tk; my $mw = new MainWindow; my $rec1 = $mw->Canvas(-height => "90", -width => "500")->pack(); $rec1->createRectangle(1,1,500,90, -fill => "black"); my $txt_tag = $rec1->createText(250,45, -justify => "center", -fill => "yellow", -font => "times 50", ); open(FILE, "sip.txt"); while ( <FILE> ) { push my @lines, [ split ]; for my $i ( 0 .. $#lines ) { for my $j ( 0 .. $#{$lines[$i]} ) { # $word = $lines[$i][$j]; $mw->after(200); print "$lines[$i][$j] "; $rec1->dchars($txt_tag,0); $rec1->insert($txt_tag,0,$lines[$i][$j]); } } } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: while loops and perl/Tk
by TheoPetersen (Priest) on Apr 16, 2001 at 23:26 UTC |