Perl Monk, Perl Meditation | |
PerlMonks |
Re: Error while taking 'Scalar of scalar'by naikonta (Curate) |
on Jul 04, 2007 at 12:14 UTC ( [id://624871]=note: print w/replies, xml ) | Need Help?? |
The coloring() subroutine returns a string (simple scalar) contains the color name, which you store in $genecolor scalar variable. You pass in the filledRectangle() method the $$genecolor, which means you're trying to dereference $genecolor. But $genecolor is a simple scalar, not a reference, hence the error.
If you look up the perldiag, or in your local system, man perldiag or perldoc perldiag, you'll find the error explanation: If you put use diagnostics; line near the top of your program, it will give you the error explanation automatically. I don't know what the filledRectangle() method expects as the fifth argument. If it says a SCALAR reference or a reference to a SCALAR then you must pass it as: Otherwise, if it says nothing about references, then just pass in the variable as is:
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
In Section
Seekers of Perl Wisdom
|
|