in reply to Re^3: How to create a hash whose values are undef?
in thread How to create a hash whose values are undef?
#!/usr/bin/perl -w use strict; use Data::Dumper; my @keys = (1,2,3); my %hash; @hash{@keys} = (undef) x @keys; print Dumper \%hash; __END__ Prints: $VAR1 = { '1' => undef, '3' => undef, '2' => undef };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to create a hash whose values are undef?
by cdarke (Prior) on Jul 07, 2009 at 07:36 UTC |