Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere Server - Programming » Perl DBI support » Perl scripts that use DBD::SQLAnywhere

 

Loading the DBI module

To use the DBD::SQLAnywhere interface from a Perl script, you must first tell Perl that you plan to use the DBI module. To do so, include the following line at the top of the file.

use DBI;

In addition, it is highly recommended that you run Perl in strict mode. This statement, which for example makes explicit variable definitions mandatory, is likely to greatly reduce the chance that you will run into mysterious errors due to such common mistakes as typographical errors.

#!/usr/local/bin/perl -w
#
use DBI;
use strict;

The DBI module automatically loads the DBD drivers, including DBD::SQLAnywhere, as required.