in reply to database connection output
Consult Writeup Formatting Tips. In it, you will learn to encase your code in a <code> block. Note that where you meant to write
your entry presents$_[1]
use strict. That would have told you that your $data variable was never used.
You are just obfusciating your code by defining
Either just use the @_ variables directly, or give them meaningful variable names:my $parm1 = $_[0]; #sql statement my $parm2 = $_[1]; #server my $parm3 = $_[2]; #username my $parm4 = $_[3]; #password my $parm5 = $_[4]; #dbname # etc
Putting a variable in doublequotes by itself (as you're doing with parm3 and parm4) is pernicious.my($sql_statement, $server, $username, $password, $dbname) = @_;
my $dbh=DBI->connect("dbi:Sybase:$parm2","$parm3", "$parm4" ) or die D +BI::errstr;
|
|---|