perl -pi -e 's/^\/+$/9999/g'
30 /// 10 40 23 44 // //// 31 / 54 /
30 9999 10 40 23 44 9999 9999 31 9999 54 9999
-i used with no filenames on the command line, reading from STDIN.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!