#!/usr/bin/perl
use strict;

package mymodule;

require Exporter;
our @ISA     = qw(Exporter);
our @EXPORT  = qw(read_tabfile);
our $VERSION = 1.00;

sub read_tabfile {

    my $infile = $_[0];
    if ( $infile eq '' ) { die "Could not find file $infile\n"; }
    my @array = ();
    my $i     = 0;
    open IN, $infile or die "Could not open file $infile\n";
    while (<IN>) {
        unless (/^#/) {
            chomp;
            my @columns = split("\t");
            for ( my $j = 0 ; $j <= $#columns ; $j++ ) {
                $array[$i][$j] = $columns[$j];
            }
	    $i++;
        }
    }
    close IN;
    return ( \@array ); # reference to array

}
1;

