Larry Sandwick wrote: > > In the program below the if statement that qualifies the IP address > never evaluates to be false, for what ever reason the form is always > processed. Can anybody help me with this problem? > > The code should only allow computers with certain IP's to access the > data to be processed. I know it sound different, but I have been asked > to validate the IP's which are assigned by building location to access > the data#! > > The first time through the code it will always generate the form, and > the second time through it has the ip address and validates the IP and > then processes the form if it has a valid IP. > > I have tried the code with "eq" and "==" and it makes no difference. I > would think I need to use the "eq" because it is not a valid number... > [uhm]I could be wrong...would not be the first time!
Yes, you need to use eq because you are comparing strings. If you want to compare IP addresses as numbers you will have to convert them to integers using Socket::inet_aton() or pack and unpack. It could be that the IP address you are trying to compare has a newline at the end? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]