# This package is for handling rdb files package READ_RDB; use English; use FileHandle; use Exporter; @ISA = qw(Exporter); @EXPORT = qw( read_rdb_header ); # prototypes sub read_rdb_header(*); # read in the header of an RDB file and store the column names in @::col_names # with a reversed index in %::col_num. sub read_rdb_header(*) { my ($FILE) = @_; # skip the comments at the beginning while (<$FILE> ) { last if !( /^\s*#/); } # read the column names chomp; @::col_names = split(/\t/); # index the column names undef(%::col_num); for($i = 0; $i<=$#::col_names; $i++) { $::col_num{$::col_names[$i]} = $i; # print STDERR "column $i is $::col_names[$i]\n"; } # skip the field-length definitions <$FILE>; } # packages must end with a true value---a restriction that seems # to be poorly documented. 1;