in reply to PERL Sybase Connection

You are missing the semicolon at the end of the use DBI line.

This lets Perl think that you wanted to pass some additional arguments to the use command, but then these arguments are empty, which confuses DBI as it seems to DBI that you are asking for an unnamed command for it to export. That error message is unfortunate but not easily fixable in a more general sense.

Replies are listed 'Best First'.
Re^2: PERL Sybase Connection
by vighneshmufc (Acolyte) on Feb 08, 2018 at 09:20 UTC
    I changed the format to CTlib
    my $esm_server = $ENV{'ESM_SERVER'}; die "ESM_SERVER is not set\n" u +nless defined $esm_server; 3 die "ESM_SERVER is empty\n" unless( length($esm_server) > 0 ); 4 print "server is $esm_server\n"; 5 my $esm_user = $ENV{'ESM_DBO'}; die "ESM_USER is not set\n" un +less defined $esm_user; 6 die "ESM_USER is empty\n" unless( length($esm_user) > 0 ); 7 print "user is$esm_user\n"; 8 my $esm_passwd = $ENV{'ESM_DBO_PASSWD'}; die "ESM_PASSWD is not + set\n" unless defined $esm_passwd; 9 die "ESM_PASSWD is empty\n" unless( length($esm_passwd) > 0 );; 10 11 12 use Sybase::CTlib; 13 require "$ENV{ESM_LIB_PERL}/sybCTlib.pl"; die "Not there" unless $ +ENV eq ""; 14 15 my $dbh = Sybase::CTlib ->new( $esm_user,$esm_passwd,$esm_server); ~
    Kinly guide me why do i get Can't locate Sybase/CTlib.pm
    The error msg is
    Can't locate Sybase/CTlib.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at databasee.txt line 18. BEGIN failed--compilation aborted at databasee.txt line 18.

      Seriously, why did you try to change to Sybase::CTlib if you don't have that module installed?

      The only thing you need to change in your original script is to add the missing semicolon, provided you have the Sybase DBD driver installed (DBD::Sybase).

      Kinly guide me why do i get Can't locate Sybase/CTlib.pm

      Perhaps because you have not installed Sybase::CTlib? Use diagnostics to help you understand error messages in future.