in reply to Using GD in a CGI script to randomly select images fails...
A common mistake is to assume the current directory is the directory in which the script resides. If that's the case here, you could be attempting to load images which cannot be found.
One solution is to explicitely switch the current directory to the one containing the script.
use File::Basename qw( dirname ); use File::Spec::Functions qw( rel2abs ); BEGIN { chdir(dirname(rel2abs($0))); }
By the way, could you explain what exec $0 if not $imgStream; accomplishes (besides introducing a potential infinite loop)?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using GD in a CGI script to randomly select images fails...
by blue_cowdawg (Monsignor) on Aug 07, 2007 at 20:11 UTC |