in reply to strict and warnings but no error?
In line 5 you attempt to (wrongly) dereference $var before the end of the statement, but you wind up dereferencing an anonymous hash (with keys 'one' and 'red') by a key ,'fish', that doesn't exist, giving $var the value undef. You can assign $var what you intended with:
my $var; @{$var}{ qw( one two red blue )} = ('fish') x 4;
Update: I thought you wanted to know why no error. Adapting slices to your real data:
my $ext = {}; for (keys %$mime) { my $case = { description => $_, icon => $mime->{$_}{icon}, }; my @exts = @{$mime->{$_}{ext}}; @{$ext}{@exts} = ($case) x @exts; }
After Compline,
Zaxo
|
|---|