【发布时间】:2017-02-19 14:49:44
【问题描述】:
我在 Perl 中将文件读入哈希时遇到了一些问题。
Chr1_supercontig_000000000 1 500
PILOT21_588_1_3_14602_59349_1
Chr1_supercontig_000000001 5 100
PILOT21_588_1_21_7318_90709_1
PILOT21_588_1_43_18803_144592_1
PILOT21_588_1_67_13829_193943_1
PILOT21_588_1_42_19678_132419_1
PILOT21_588_1_67_4757_125247_1
...
所以我上面有这个文件。我想要的输出是以“Chr1”行作为键,“PILOT”行作为值的散列。
Chr1_supercontig_000000000 => PILOT21_588_1_3_14602_59349_1
Chr1_supercontig_000000001 => PILOT21_588_1_21_7318_90709_1, PILOT21_588_1_43_18803_144592_1,...
据我所知,多个值只能通过引用分配给一个键,对吗?
我被困在这一点上,需要帮助。
【问题讨论】: