Creating a Perl Object

Install Perl and create a Perl object before installing the new Perl object into the SAP Sybase IQ database.

Prerequisites
Task
  1. Run Makefile.PL:
    • From the SDK\PerlEnv subdirectory (Windows):
      perl Makefile.PL
      nmake
      nmake install
    • From the sdk/perlenv subdirectory (UNIX):
      perl Makefile.PL
      make
      make install
  2. Verify that the database server is able to locate and start the Perl executable:
    START EXTERNAL ENVIRONMENT PERL;
  3. Write Perl scripts that use the DBD::SQLAnywhere interface. Sybase recommends running Perl in strict mode:
    #!/usr/local/bin/perl -w
    #
    use DBI;
    use strict;
    my $database = "demo";
    my $data_src = "DBI:SQLAnywhere:SERVER=$database;DBN=$database";
    my $uid      = "DBA";
    my $pwd      = "sql";
    my %defaults = (
         AutoCommit => 1, # Autocommit enabled.
         PrintError => 0  # Errors not automatically printed.
       );
    my $dbh = DBI->connect($data_src, $uid, $pwd, \%defaults)
      or die "Cannot connect to $data_src: $DBI::errstr\n";
    $dbh->disconnect;
    exit(0);
    __END__
Related concepts
Perl Objects in SQL Procedures and Functions
Related tasks
Installing a Perl Object into an SAP Sybase IQ Database
Updating a Perl Object
Deleting a Perl Object
Viewing or Modifying Perl Object Properties.
Testing the Configuration of a Perl External Environment
Viewing or Modifying Perl External Environment Properties
Related reference
Perl External Environment Privilege Summary