I got this snippet of code for automating DNS zone file handling, and was
wondering what it means. I know that it is looking for files that don't match
the pattern xxx.xxx.xxx.in-addr.arpa, where x is numeric:
if ($zone !~ m%^(?:((?:\w[-A-Za-z0-9]*\.)+\w\w+)|((?:(?:[12]
[0-9][0-9]|[1-9][0-9]?)\.){2,4})[Ii][Nn]-[Aa][Dd][Dd][Rr]\.[Aa]
[Rr][Pp][Aa]\.?)$%x){
m = treat the string as multiple lines (not sure why this should happen)
%=mod, doesn't make sense to me
^ = beginning of string
?: = pattern match up to : *or* right operator
\w[-A-Za-z0-9] = look for character that isn't alpha (is that what the leading
'-' is?) up to the first '.'
I pretty much get lost after that. I think its verifying that the the first 3
numbers must be 1 or 2, the second and third three must be 0-9. I'm not sure
what the '|' symbol is for either.
Andrew
---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]