1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl -00 $* = 1; while (<>) { if (/^do_(\w+)/) { open(OUT, ">>do/$1"); } print OUT; chop; chop; close OUT if chop eq '}' && chop eq "\n"; }