#! /usr/bin/perl -w use DBI; my $dbh = DBI->connect('DBI:Pg:database=piperka', 'kaol', undef, {AutoCommit => 0}); my $sth = $dbh->prepare('select ord from alphabet_index'); my $ord; $sth->execute; $sth->bind_columns(\$ord); open OUT, ">/home/kaol/alphabet_index"; while($sth->fetch) { print OUT "$ord\n"; } close OUT; $sth->finish; $dbh->disconnect; exec '/home/kaol/bin/comictitles_gen';