use strict; use warnings; my %hash = map { /(TCONS_00[0-9]+)\s+(XLOC_[0-9]+)/ } <DATA>; my @keys= keys %hash; my @values= values %hash; print "@keys\n"; print "@values\n"; __DATA__ TCONS_00000047 XLOC_000039 TCONS_00000718 XLOC_000456 TCONS_00000938 XLOC_000610 TCONS_00004086 XLOC_002872 TCONS_00004252 XLOC_003003 TCONS_00004975 XLOC_003624 TCONS_00004976 XLOC_003624 TCONS_00005492 XLOC_004020
In reply to Re: create hashes using regex
by hdb
in thread create hashes using regex
by bingalee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |