I would like to add $tjeneste_type to $row.
Can anybody tell me how to do that??
BR Soren
************The Code**************
#!/usr/local/bin/perl -wT use strict; use HTML::Template; use CGI; use DBI; my $cgi = new CGI; use constant TMPL_FILE => "$ENV{DOCUMENT_ROOT}/um/templates/status.tmp +l"; my $tmpl = new HTML::Template( filename => TMPL_FILE ); my $search = $cgi->param("search"); my $tjenestested = $cgi->param("tjenestested"); my $dbh = DBI->connect("um","","","mysql") || die "Could not connect: $DBI::errstr\n"; my %attr = ( dbi_fetchall_arrayref_attr => {} ); my $row = $dbh->selectall_arrayref("select fornavn, efternavn, cpr, ad +resse, zip, city, g_afsluttet, bemyndigelse_til from people where (id + like '%$search%')",\ %attr); my $tjeneste_type; if ($tjenestested =~ /^Konsulent/) { $tjeneste_type = 'kon'; } else { $tjeneste_type = 'um'; } #ADD $tjeneste_type to $row??? $tmpl->param( row => $row ); print "Content-type: text/html\n\n", $tmpl->output; $dbh->disconnect;
Edit - Petruchio Thu Oct 18 10:34:45 UTC 2001: Added code tags, cleaned up markup.

In reply to ADD $tjeneste_type to $row by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.