1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/contrib/amd/m4/chop-aclocal.pl
2003-09-02 15:27:38 +00:00

20 lines
392 B
Perl
Executable File

#!/bin/perl -w
$seq = 1;
$file = "";
$file = sprintf("tmp/%02d.m4", $seq);
open(FILE, ">$file") || die "cannot open \"$file\": $!";
printf(STDOUT "FILE: $file\n");
while (<>) {
if (/^$/) {
close(FILE);
$seq++;
$file = sprintf("tmp/%02d.m4", $seq);
open(FILE, ">$file") || die "cannot open \"$file\": $!";
printf(STDOUT "FILE: $file\n");
next;
}
printf FILE;
}
close(FILE);