my $x = { map {; $_ + 1 => (qw/Jan Feb Mar/)[$_] } 0 .. 2 }
Perl 6 solution:
my $x = hash <Jan Feb Mar ...> Z 1..12;
You can emulate that in Perl 5 with the zip() function from List::MoreUtils
In reply to Re: On-the-fly hashref
by moritz
in thread On-the-fly hashref
by oko1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |