On Fri, 15 Apr 2005, Bob wrote:

Robert Spier wrote:

What are you trying to do?
...
As John pointed out, Data::Validate::IP has "is_ivp4" and
other methods which test a string for whether it is, not
contains, but is an ip, also known as a dotted quad, of the
form n.n.n.n, where n is between 0 and 255

I want a host, so the last n ought not to be zero(most likely
a network), or 0.0.0.0, worse, meaning open on all interfaces.
Mainly I don't want a bad config string to be or to get parsed
down to "", stored as 0, assumed to mean 0.0.0.0, where we
DON'T want to advertise passwords. That's my goal.

OK, we'll that's additional validation, to be applied after you've verified that a valid IP address has been provided. So you're doing additional semantic validation after you've done the syntactic validation.


I'm not commenting on what should might be reasonable semantic validation.

In my experience, trying too hard to prevent admins from putting bad data in configs often results in late delivery of software, and too many additional bugs.

---
Charlie



Reply via email to