in reply to Re^3: algorithm for network address enumeration
in thread algorithm for network address enumeration

You're right to subtract both the first and last addresses that fall under the mask, but if the input contains an explicit broadcast address like the OP says it's better to stick with that for output; I believe some old equipment uses 0 instead of -1 for broadcast.

I provided an excessive amount of info, so that he can easily customize it to his needs.

And your regexp works, but "\." is a bit better than ".".)

Thanks. Noticed and fixed. Actually, I replaced the regexp with split(/\./). It's probably a tad slower, but it mirrors the join.