blib/script/headeridx.pl untested

filter: Statementstmt 0.0% 0 / 38 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod n/a totaltotal 0.0% 0 / 52 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2 # created on 2013-07-28
3  
4 use warnings;
5 use strict;
6 use 5.010;
7  
8 use Data::Printer;
9 use Bio::Gonzales::Util::File qw/openod/;
10  
11 use Pod::Usage;
12 use Getopt::Long qw(:config auto_help);
13  
14 my %opt = ( comment => '#' );
15 GetOptions( \%opt, 'comment=s' ) or pod2usage(2);
16  
17 my $file = shift;
18 die "$file is no file" unless ( -f $file );
19  
20 ( my $fh, undef ) = openod( $file, '<' );
21  
22 my $header = <$fh>;
23  
24 my $first_line;
25 while ( $first_line = <$fh> ) {
26 last if ( $first_line !~ /\s*$opt{comment}/ );
27 }
28  
29 $fh->close;
30  
31 chomp $header;
32 chomp $first_line;
33  
34 my @h = split /\t/, $header;
35 my @fl = split /\t/, $first_line;
36  
37 p \@h;
38 p \@fl;