jonadab has commented ably on a solution to your problem. I have some other suggestions.

Consult Writeup Formatting Tips. In it, you will learn to encase your code in a <code> block. Note that where you meant to write

$_[1]
your entry presents
$_1
Mouse over the '1' and Note how the itis hyperlinked to perlmonks node 1. The square brackets link to articles unless they are enclosed in <code>

use strict. That would have told you that your $data variable was never used.

You are just obfusciating your code by defining

my $parm1 = $_[0]; #sql statement my $parm2 = $_[1]; #server my $parm3 = $_[2]; #username my $parm4 = $_[3]; #password my $parm5 = $_[4]; #dbname # etc
Either just use the @_ variables directly, or give them meaningful variable names:
my($sql_statement, $server, $username, $password, $dbname) = @_;
Putting a variable in doublequotes by itself (as you're doing with parm3 and parm4) is pernicious.
my $dbh=DBI->connect("dbi:Sybase:$parm2","$parm3", "$parm4" ) or die D +BI::errstr;

In reply to Re: database connection output by throop
in thread database connection output by dreman

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.