1#!/usr/bin/perl 2 3use strict; 4 5my $cur_struct = ""; 6my $printed = 0; 7 8while (<>) { 9 if ($_ =~ /^struct (\w+) {/) { 10 $cur_struct = $1; 11 $printed = 0; 12 next; 13 } 14 if ($_ =~ /.* hole,.*/ && !$printed) { 15 print "$cur_struct\n"; 16 $printed = 1; 17 } 18} 19