xref: /netbsd-src/external/bsd/am-utils/dist/m4/chop-aclocal.pl (revision a53f50b9b44dc9467ccc9c464999b1d1c509cb0c)
1#!/bin/perl -w
2
3$seq = 1;
4$file = "";
5$file = sprintf("tmp/%02d.m4", $seq);
6open(FILE, ">$file") || die "cannot open \"$file\": $!";
7printf(STDOUT "FILE: $file\n");
8while (<>) {
9    if (/^$/) {
10	close(FILE);
11	$seq++;
12	$file = sprintf("tmp/%02d.m4", $seq);
13	open(FILE, ">$file") || die "cannot open \"$file\": $!";
14	printf(STDOUT "FILE: $file\n");
15	next;
16    }
17    printf FILE;
18}
19close(FILE);
20