Keep It Simple, Stupid | |
PerlMonks |
RE: CGI and Tracerouteby redcloud (Parson) |
on Oct 19, 2000 at 03:29 UTC ( [id://37445]=note: print w/replies, xml ) | Need Help?? |
Instead of using s/// to filter out the characters you
don't want, use it to only allow the characters you do want.
How about something like: $value =~ m/([-.0-9a-zA-Z]+)/; $value = $1; That would only allow dashes, dots, and alphanumerics, which IIRC are all you are allowed to use in a fully-qualified domain name.
In Section
Seekers of Perl Wisdom
|
|