Ok... am I going mad here? Basically, the following routine *should* check to see the output of the website grabbed. In this case, it is an image grabbed from Links SQL, via jump.cgi. If the file doesn't exist, the page should contain 'Unknown' ... which the regex should pick up. For some reason though, it always returns 1! Can anyone see my boo-boo?
sub check_image_exists {
my $id = $_[1];
my $field = $_[0];
my $grabbed = get("http://www.site.com/cgi-bin/vehicles/jump.cgi?ID=$id&view=$field");
$grabbed =~ s/\n//g;
my $got = 1;
if ($grabbed =~ /Unknown/si) { $got = 0; }
$got ? return 1 : return 0;
}
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Code:
# routine to see if image exists... sub check_image_exists {
my $id = $_[1];
my $field = $_[0];
my $grabbed = get("http://www.site.com/cgi-bin/vehicles/jump.cgi?ID=$id&view=$field");
$grabbed =~ s/\n//g;
my $got = 1;
if ($grabbed =~ /Unknown/si) { $got = 0; }
$got ? return 1 : return 0;
}
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

