#!/usr/bin/perl open IN, "in.txt" or die "Can't Open input\n"; $count = 0; while () { chomp($_); if ($_ =~ /Users/) { print $_,"\t=\t"; } elsif ($_ =~ /\.\.\./) { print $count,"\n"; $count = 0; } else { if ($_) { $count++; } } } #### Users of some feature = 3 Users of some other feature = 3 Users of yet another feature = 0