rewrite header.sed in perl because sed wont handle multiple files for me
[hband-tools.git] / user-tools / header
blob0d06ac6587be7ec0d223b8068b243c1c42717f82
1 #!/usr/bin/env perl
3 =pod
5 =head1 NAME
7 header - Echo the input stream up to the first empty line (usual end-of-header marker)
9 =head1 SYNOPSIS
11 header <FILE> [<FILE> [<FILE> [...]]]
13 =cut
16 for my $idx (0..$#ARGV)
18 my $path = $ARGV[$idx];
19 open my $fh, '<', $path;
20 while(<$fh>)
22 last if /^\r?\n?$/;
23 print;
25 if($idx < $#ARGV)
27 print "\n";