1 #!/usr/bin/perl
   2 
   3 use strict;
   4 
   5 my $cur_struct = "";
   6 my $printed = 0;
   7 
   8 while (<>) {
   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 }