Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: RE: problem with using variable
Date: Jul 21 2003 5:36PM

For some reason, chomp is not getting rid of the new line character at the
end of the line which is messing things up. Any Ideas as why chomp could be


-----Original Message-----
From: WORENKLEIN, David, GCM []
Sent: Monday, July 21, 2003 1:30 PM
To: 'Sabherwal, Balvinder (MBS)'
Subject: RE: problem with using variable

When you print the password to see what it is, make sure you use

print "'$pwd'\n";

The extra single quotes may help you spot something

-----Original Message-----
From: Sabherwal, Balvinder (MBS)
Sent: Monday, July 21, 2003 8:30 AM
To: ''; David Owen
Cc: ''
Subject: RE: problem with using variable
Importance: High

>>Yes, that's exactly what happens - the foreach loop sets the value of
>>$pwd for use inside the loop, but it clears it before exiting the loop.
>>If your file has a single password in it I'd maybe use something like
>>   local $/ = undef;   # read the entire file in one go
>>   open(IN, "/tmp/passwd") || die "Can't open pwd file: $!";
>>   $pwd = ;
>>   $pwd =~ s/\s*$/;   # remove any trailing spaces
>>   chomp($pwd);
>>   close(IN);

This still is not helping. I tried and the script is still acting the same.
I did added the print after the block of code to make sure $pwd has right
value and it dose. Any more clues??