#!/usr/bin/perl #twolcount.pl $| = 1; $r = 0; $t = 0; while (<>) { $lines[$i++] = $_; if (/^$/) { printf "#r=$r#t=$t\n", ; print @lines; undef @lines; $r = 0; $t = 0; $i = 0; } if (/^\t[(]?["].+["] (.+)/) { # reading # printf STDERR "\ntwolcount tags: $1"; @array = split /[ =-]/, $1; $tags = $#array+1; $t += $tags; $r++; } }