>-----Original Message-----
>From: M.W. Koskamp [mailto:[EMAIL PROTECTED]]
>Sent: Sat 21 Apr 2001 11:08
>To: David Gilden; [EMAIL PROTECTED]
>Subject: Re: Populating Hashs and checking multi form fields 
>
>
>
>----- Original Message -----
>From: David Gilden <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, April 21, 2001 2:49 AM
>Subject: Populating Hashs and checking multi form fields
>
>
>
>> # stuff $pwd in to @indata
>> open(FILE,$pwfile) || die &dead("Can't find $pwfile. $!");
>> @indata = <FILE>;
>This will only read one line from the file, Is that what you 
>want? If no use: @indata = FILE->getlines();


David .. ignore the above .. your code is correct

M.W. .. the diamond operator in list context returns all lines in the file
.. each line as a separate element in the list .. so after David's code
above each line from the file is an element in the @indata array

>Try something like this
>
>
>&dead("Password, Sorry") if !authorize($user, $pwd);
>
>Sub autorhorize{
>
>  my ($user, $pwd) =@_;
>  open (FH, "<$pwfile") || die $!;
>  while (<FH>) {
>     return 1 if $_ eq "$user|$pwd";
>  }
>}

this will never return '1' because $_ will always contain an line-ending
character .. so the equality test will always fail

-- 
  jason king

  In Spearfish, South Dakota, if three or more Indians are walking down
  the street together, they can be considered a war party and fired
  upon. - http://dumblaws.com/

Reply via email to