Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GD::Image=SCALAR(ox804b688)

Status
Not open for further replies.

1surya

Programmer
Jul 14, 2002
25
CA
Hi
I am trying to draw an image i using GD module of perl on linux.
I have installed GDmodule
lippng
Zlib
my code goes as follows

use strict;
use GD;
my $Im=new GD::Image(100,100);
my $white=$im->colorAllocate(255,255,255);
my $black=$im->colorAllocate(0,0,0);
my $red=$im->colorAllocate(255,0,0);
my $blue=$im->colorAllocate(0,0,255);
$im->transparent($white);
$im->interlaced('true');
$im->rectangle(0,0,99,99,$black);
$im->arc(50,50,95,75,0,360,$blue);
$im->fill(50,50,$red);
binmode STDOUT
print $im;
when I try to run this program at my console I am getting GD::Image=scalr(ox804b688);
I don't know where I went wrong.
Can anybody help me to fix it .
Thanks a lot







 
never used GDIMage, but $Im is defined, then $im is used which is not defined anywhere as far as I can see. Perl is case sensitive and $Im is not $im, I believe, so change $Im to $im

good luck, svar
 
best way to get rid of this kind of error is to put

use strict;
use warnings;

at the beginnning of *every* script you write. Mike
________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
I'm getting the same exact error with my GD script and I can't figure it out either. I'm using strict and warnings and it doesn't help at all.
 
My error comes about when I try to do a 'copy' through GD
 
I edited my script and included
use warnings;
I created the the image object
$im but not $Im
i mistakenly typed $Im instead of $im.
Even if I inclued
use warnings;
it doesn't prompt me any warnings.it simply printing the
hexadecemal value of the image object.
I will be very thankful if anybody can help me to fix it.
1surya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top