in reply to Adding missing values into a hash
Second You would probably better off storing your metadata keys in an array rather than a hash, because an array preserves the order of the data (and not a hash).
Third, a regex might be simpler than a split if you just want to remove the trailing comma:
Fourth, I do not see any \t in tour input.while (my $line = <I1>) { chomp $line; if ($line =~ /##INFO=<ID=/) { $line =~ s/,$//; # ... }
Fifth, reading the file twice does not seem to be a very good idea. Can't you decide, based on the content, that you have finished reading the metadata and started to read the data?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Adding missing values into a hash
by Biopolete (Initiate) on Jun 19, 2014 at 14:36 UTC |