|
|
sybperl-l Archive
Up Prev Next
From: David Owen <dowen at midsomer dot org>
Subject: Re: problem with using variable
Date: Jul 19 2003 3:27PM
On Fri, 2003-07-18 at 10:38, Sabherwal, Balvinder (MBS) wrote:
> 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";
> }
Try a 'print "$pwd\n";' just here. What is it set to? I suspect that
$pwd is being unset by the loop.
>
> my $dbh=Sybase::CTlib->ct_connect("DBUSER","$pwd","SYB_NJ2");
> if ( ! defined($dbh) )
> {
> print "Can't connect to server !! exiting.. \n";
> exit(1);
> }
dowen
--
David Owen Midsomer Consultants Inc. dowen@midsomer.org
Maintainer of the Sybase FAQ: http://www.isug.com/Sybase_FAQ
|