IPV4 subnet list cleaner (in CIDR notation)
CJam, 101 95 94
qN/{'//('./1\+256b2b\{i)&lt;}/}%_|{{):T;_aM+:M(a&amp;}gT+}%${_2$#!{;}*}*]{_(!a32*+32&lt;8/2fb'.*'/@,(N}%

The {~}2j construct didn't make it shorter...
Try it here. (And link for Firefox.)
Explanation
qN/               &quot; Read each line. &quot;;
{                 &quot; For each line: &quot;;
    '//           &quot; Split by / &quot;;
    ('./          &quot; Split first item by . &quot;;
    1\+256b2b     &quot; The address + 2^32 in base 2, which always has length 33 &quot;;
    \{i)&lt;}/       &quot; For each other items N (if any), get the first N+1 bits. &quot;;
}%
_|                &quot; Remove duplicates. &quot;;
{                 &quot; For each item (each array of bits): &quot;;
    {             &quot; Do: &quot;;
        ):T;      &quot; Remove last bit and save it in T. &quot;;
        _aM+:M    &quot; Add the array to M. &quot;;
        (a#)      &quot; Find the array in the original M. &quot;;
    }g            &quot; while it is found. &quot;;
    T+            &quot; Append the last T back. &quot;;
}%
$                 &quot; Sort. &quot;;
{                 &quot; Reduce and wrap in array: &quot;;
    _2$#!         &quot; Test if the previous string is a prefix of the current. &quot;;
     {;}*         &quot; If so, discard it. &quot;;
}*]
{                 &quot; For each item (each array of bits): &quot;;
    _(!a32*+32&lt;   &quot; Remove first bit and pad to 32 bits to the right. &quot;;
    8/2fb'.*      &quot; Convert to IP address. &quot;;
    '/@,(         &quot; Append / and original length - 1. &quot;;
    N             &quot; Append a newline. &quot;;
}%