#!/usr/bin/perl use strict; use warnings;use CGI::Carp qw(fatalsToBrowser); use DBI; use DBD::AnyData; print qq[content-type: text/html\n\n]; my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); my $table = 'mothers'; my $format = 'Pipe'; my $file = 'databases/mothers.tbl'; my $flags = ''; # The first row holds the field names $dbh->func( $table, $format, $file, $flags, 'ad_catalog'); my $sth = $dbh->prepare("SELECT * FROM mothers WHERE name = 'Sandra'"); $sth->execute(); while (my $row = $sth->fetch) {print "@$row
";} 1; #### name|age|address|phone Sandra | 46 | 1252 Some St, Anywhere, WI 12345 | 123-456-7890 #### if (ref($file) eq 'ARRAY'){print join("\n", $format, @$file, $createMode), "\n";}
else {print join("\n", $format, $file, $createMode), "\n";}