cool has asked for the wisdom of the Perl Monks concerning the following question:
Can't use string ("lightblue") as a SCALAR ref while "strict refs" in use at a.pl line 184, <STDIN> line 2.
I am using a subroutineIn main code, calling my subsub coloring{ my @color= qw( lavender lightblue honeydew); my $color_no=int(rand($#color)); return $color[$color_no]; }
How to deal with $$genecolor issue?? Pl help/suggest.my $lavender=$im->colorAllocate(230,230,255); my $lightblue=$im->colorAllocate(173,216,230); my $honeydew=$im->colorAllocate(240,255,240); while(@ary) { my $genecolor= coloring (); $im->filledRectangle($X1,$Y1-20,$X2,$Y2,$$genecolor); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error while taking 'Scalar of scalar'
by tirwhan (Abbot) on Jul 04, 2007 at 12:07 UTC | |
by bart (Canon) on Jul 05, 2007 at 12:36 UTC | |
by cool (Scribe) on Jul 04, 2007 at 16:25 UTC | |
|
Re: Error while taking 'Scalar of scalar'
by tinita (Parson) on Jul 04, 2007 at 12:15 UTC | |
by bart (Canon) on Jul 05, 2007 at 12:39 UTC | |
|
Re: Error while taking 'Scalar of scalar'
by naikonta (Curate) on Jul 04, 2007 at 12:14 UTC | |
|
Re: Error while taking 'Scalar of scalar'
by jettero (Monsignor) on Jul 04, 2007 at 12:16 UTC |