in reply to assigning to a hash via split
I basically create the hash reference and assign to it all at once.while (<IN>) { chomp; my ($name) = /([^:]+)/; @{ $users{$name} }{ @fields } = split /:/; }
chomp(@{$users{(/([^:]+)/)[0]}}{@fields} = split /:/) while <IN>;
|
|---|