my $DB = DBI->connect("dbi:Pg:host=roadstar", "", "",
{ AutoCommit => 0, RaiseError => 1 });
-my $st = $DB->prepare("SELECT title, ndisc, path FROM old_dvd ORDER BY title");
+my $st = $DB->prepare
+ ("SELECT title, ndisc, path FROM old_dvd ORDER BY title");
$st->execute;
-my $st1 = $DB->prepare("INSERT INTO dvd (title, disc, path) VALUES (?, ?, ?)");
-ROW: for (;;) {
- my @r = $st->fetchrow_array; last ROW unless @r;
+my $st1 = $DB->prepare
+ ("INSERT INTO dvd (title, disc, path) VALUES (?, ?, ?)");
+while (my @r = $st->fetchrow_array) {
my ($title, $ndisc, $path) = @r;
print ";; $title [$ndisc]\n";
for (my $i = 0; $i < $ndisc; $i++) { $st1->execute($title, $i, $path); }