Johnson, Shaunn wrote:
> ...
> my $sth = $dbh->prepare ($statement);
> $sth->execute();
> 
> while ( my($first, $second)=$sth->fetchrow ) {
>    print FILE "$first\t\t$second,\n";
>         }

This code can be written as one line, and solves the comma issue:

   print join ",\n", map join("\t\t", @$_),
@{$dbh->selectall_arrayref($statement)};

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to