|
|
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 12:30PM
>>
>>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
>>this:
>>
>>{
>> 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??
|