in reply to Check IP addresses for good form

sub valid { (grep { (m/^(\d{1,3})$/ and $_ <= 255) or return 0 } split +(/[.]/, shift)) == 4 }

update: changed (note the 'or return 0').

-- ar0n, Minimalist by nature

Replies are listed 'Best First'.
RE: (ar0n) Same thing, one line
by merlyn (Sage) on Aug 16, 2000 at 18:44 UTC