我在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,...
据我所知,只有通过引用才能将多个值分配给一个键,这是正确的吗?
在这一点上我卡住了,需要帮助。
\s
处截断$key
,以获取仅为'Chr1_supercontig_000000000'
而不是'Chr1_supercontig_000000000 1 500'
。 - mu is too short$hash{$key}
。 - TLP