This should do what you want:
my %hash = map /(\w+)/ ? ( $1, 1 ) : (), <>;
Maybe it should, but it doesn't: only maps first word from each line.
In reply to Re^2: Having trouble loading a hash with map
by AnomalousMonk
in thread Having trouble loading a hash with map
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |