All pastes #993972 Raw Edit

Miscellany

public text v1 · immutable
#993972 ·published 2008-04-23 00:35 UTC
rendered paste body
#!/usr/bin/perl
use DBI;
$|=1;
my $dbh = DBI->connect('DBI:mysql:foodb:localhost', 
                       'user', 'pass');
my $sth = $dbh->prepare("SELECT a FROM table
                        WHERE b = ?");
my $b;

    while (my $a = <STDIN>) {
        chomp $a;
        $sth->execute($a);
        $sth->bind_columns(\$b);
        $sth->fetch;

        print "$b\n";
    }