#!perl use strict; use CGI qw(:standard); use DBI; my $dbh = get_dbh(); # html page print header,start_html; my $sql = 'SELECT id,name,description,vers FROM software_repos'; my $sth = $dbh->prepare($sql); $sth->execute(); print q!
| ID | Name | Description | Version | |
| $f[0] | $f[1] | $f[2] | $f[3] |
##
#!perl
use strict;
use CGI qw(:standard);
use DBI;
my $id = param('id');
my $dbh = get_dbh();
my $sql = "SELECT bin FROM software_repos WHERE id=?";
my ($pdf) = $dbh->selectrow_array($sql,undef,$id);
print header('application/pdf'),
binmode(STDOUT);
print $pdf;
# whatever you need to get a connection
sub get_dbh{}