>>346
もしそのあとに何かDBでするんだったらPL/pgSQLで書いたほうが
いいとは思うが、Perlからやるんだったらこうか?

my $dbh = DBI->connect(...);
my $sth = $dbh->prepare( 'SELECT 1 FROM images WHERE url = ?' );
$sth->execute( $string );
if( $sth->fetchrow_arrayref ) { # 多分$sth->rowsでも平気かな
print "ある\n";
} else {
print "ない\n";
}
$dbh->disconnect;