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) #### 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; }