PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: problem with using variable
Date: Jul 18 2003 4:38PM

Guru's,

Can some one on the list help me find the problem with the code below. I'm
not able to connect to the server using the below code. The problem is with
the $pwd variable. If I hard code the password in here, everything works
fine. What am I missing??


#!c:/perl/bin/perl.exe
use strict;
use DBA_Lib::DBConnect;
use DBA_Lib::SendMsg;
use Spreadsheet::ParseExcel;
use Sybase::CTlib;

my $oExcel = new Spreadsheet::ParseExcel;
my (@fl , $usrfname , $usrdbid , $data , $mmsg_syb , $pwd , $mmsg_ora );

if ( ! open( PW , 'c:\tmp\dbpass_nj2') ) { die "Error : $!\n" ; } ## get the
password for dbuser
@fl= ; ## get the password for dbuser

foreach $pwd ( @fl )
{
   chomp($pwd); ## Remove new line characters at the end.
   print "$pwd \n";
}

my $dbh=Sybase::CTlib->ct_connect("DBUSER","$pwd","SYB_NJ2");
if ( ! defined($dbh) )
{
   print "Can't connect to server !! exiting.. \n";
   exit(1);
}