eoin has asked for the wisdom of the Perl Monks concerning the following question:
Now this proves to be a wee bit confusing... Take the latter of the two, this refers to the MainLoop; function which, correct me if I'm wrong, tells perl to stop drawing widgets and start looking at the subs.Useless use of private variable in void context at rand.pl line 38 (#2 +) Useless use of a constant in void context at rand.pl line 25 (#2)
Any help would be greatly appricated, and I know it is probrably a stupid mistake but can't see it.use warnings; use diagnostics; use TK; my (@coLour, $COLOUR, @list, @tmplist, $key); my $width = 600; my $height = 600; my $i = 0; my $randi = &randi(); my $mw=MainWindow->new; my $canvas =$mw->Canvas(width => $width, height => $height)->pack(); for($i = 0; $i < $randi; $i += 1){ my $colour = &colour(); my @tmp = &xy(); $canvas->create('line', $tmp[0], $tmp[1], $tmp[2], $tmp[3], -fill +=> $colour); } MainLoop; sub colour{ @coLour = ('red', 'blue', 'green', 'black', 'orange', 'yellow'); $COLOUR = $coLour[int(rand(6))]; return $COLOUR; } sub xy{ @list = ( 1, 2, 3, 4); @tmplist; $key; foreach $key(@list){ my $temp = rand($width); push(@tmplist, $temp); } return @tmplist; } sub randi{ my $temp = rand(50); return $temp; }
If everything seems to be going well, you obviously don't know what the hell is going on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble Tracks Tk
by Thelonius (Priest) on May 27, 2003 at 11:12 UTC | |
by eoin (Monk) on May 27, 2003 at 11:19 UTC |