- if ( $_ ne '' ) {
- # skip to next _<anything> line
- $_ = <OLDHIF>;
- while ($_ ne '' && ! /^_/) { $_ = <OLDHIF>; }
-
- # print the rest
- while ($_ ne '') {
- print NEWHIF $_;
- $_ = <OLDHIF>;
- }
- }
-
- close(OLDHIF) || &tidy_up_and_die(1,"Failed reading from $ifile\n");
- close(NEWHIF) || &tidy_up_and_die(1,"Failed writing to $ofile\n");
-}
-
-sub hiSectionsOnly {
- local($ifile,$ofile) = @_;
-
- open(OLDHIF, "< $ifile") || &tidy_up_and_die(1,"Can't open $ifile (read)\n");
- open(NEWHIF, "> $ofile") || &tidy_up_and_die(1,"Can't open $ofile (write)\n");
-
- # read up to _usages_ line
- $_ = <OLDHIF>;
- while ($_ ne '' ) {
- if ( /^_(.*)_/ && $HiSection{$1} ) {
- do { print NEWHIF $_;
- $_ = <OLDHIF>;} until ($_ eq '' || /^_/ );
- } else {
- $_ = <OLDHIF>;
- }
- }