| 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; |