这是我到目前为止所拥有的。我无法创建数据库连接。
#!/usr/local/bin/perl
require "sybutil.pl";
use Sybase::DBlib;
use DBI;
my $dbhandle=&opendb;
sub opendb{
my $server ="abc.nam.aa.net";
my $user = "sam";
my $password = "abc123";
#print "Connecting to $server as $user and $password\n";
my $dbfh= new Sybase::DBlib($user, $password, $server);
if(!defined($dbfh)) {
die("Cannot connect to server.\n");
}
printf "Open database '%s' with id '%s' successful\n", $server, $user;
return $dbfh;
}
如何使用 PERL 访问 sybase?