in reply to Script won't retrieve data from database

I think by now one of the other responses may have resolved your problem. My concern here is that your solution doesn't make much sense from a performance perspective. If I absolutely HAD to read from a file, the first thing I would probably do in your case is something like this:
use DBI; my $pathname = qq|webdb.db.db3|; my $cnstr = qq|DBI:SQLite:dbname=$pathname|; my $filename = q|afile.txt|; open(H, qq|afile.txt|) or die $!; my @lines = <H>; close(H); my $IN = '('; $IN .= join ',', map { qq|\'$_\'|} grep {chomp} @lines; $IN = 'select webpage from webpages_data WHERE id in ' . $IN . ')'; print $IN; #produces : select webpage from webpages_data WHERE id in ('koko.htm', +'koko1.htm','koko2.htm','koko3.htm')
This will reduce the number of separate calls to the database. Second, I simply do not know why in the world you would reduce the performance of your solution to reading a text file when you already have a database connection open. Just create another table with your indexes and join the two, like:
select webpage from webpages_data, mySelectedStuff WHERE webpage.id = +mySelectedStuff.id AND ...
Or a sub-select cannot have much worse performance:
select webpage from webpages_data where webpage in (select id from myS +electedStuff WHERE ...)

Celebrate Intellectual Diversity