fork download
  1. #!/usr/bin/perl
  2. use 5.010;
  3. $_=$t=<>,$i=0;$t=$_,$i++while s/\w+(\((?R)(,(?R))?\))?/$1/g,/\w/;@x=$t=~/\w+/gs;say"$i:@x"
Success #stdin #stdout 0s 3564KB
stdin
2(7(2,6(5,11)),5(9(4)))
stdout
3:5 11 4