in reply to A Perl Translation Issue

See the DBI, which is the Perl abstraction. Something like the following should be what you need:

my $sth = $dbh->prepare_cached(<<SQL); select count(*) as results from database_table SQL $sth->execute(); my @results = $sth->fetchrow_array(); print $results[0];

Update: kyle noted that execute does not return the results, fetchrow_array does.