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>;
In reply to Re: assigning to a hash via split
by japhy
in thread assigning to a hash via split
by aardvark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |