Server-side setup 

#!/usr/bin/perl

use strict;
use warnings;

use CGI qw();

my $cgi = CGI->new;

print $cgi->header('text/plain; charset=utf-8');

my $q = $cgi->param('q');   # Do a DB lookup ...

print <<EOF                 # ... and generate this from results
108 Marsden Avenue, Mt Eden, Auckland
108 Marsden Point Road, Ruakaka
108 Marsden Road, Greymouth
EOF