in reply to Using GD and imageTTF
If I'm not mistaken, that puts the method call in a scalar context (you used ||), so the @cords variable is always going to be a single values that is whatever that method call does in a scalar context.my @cords = GD::Image->stringTTF(0, $font_path, $size, 0, 0, 0, $text) + || die "no cords $! $@";
I think you want:
which will die if an empty list is returned. (I don't know that interface, so I'm not sure if that's the way it indicates errors.)(my @cords = GD::Image->stringTTF(0, $font_path, $size, 0, 0, 0, $text +)) || die "no cords $! $@";
Or, without the annoying parens:
which I would prefer, including the hanging indent on the next line.my @cords = GD::Image->stringTTF(0, $font_path, $size, 0, 0, 0, $text) or die "no cords $! $@";
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Using GD and imageTTF
by neilwatson (Priest) on Mar 29, 2003 at 17:12 UTC |