ianand0204 has asked for the wisdom of the Perl Monks concerning the following question:
This seems to take care of creating my array. The problem lies when converting my array into a hash. The code I have below is what I have come up with, but since the only real data I care about in the hash is the "key" do I need to add a value to it?use File::Find::Rule; use Data::Dumper; my $rule = File::Find::Rule->new; $rule->file; $rule->name( '*.zone' ); my @files = $rule->in("/home/dns");
perl test.cgi%hash = map { $files[$_], $_ + 1 } 0 .. $#files; foreach my $name (sort keys %hash) { my $host = $hash{$name}; print $host; my %row = { name => $name, };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Populating an Array of hash's
by ikegami (Patriarch) on Oct 01, 2008 at 02:26 UTC | |
by tinita (Parson) on Oct 02, 2008 at 10:14 UTC | |
by ianand0204 (Initiate) on Oct 01, 2008 at 15:47 UTC | |
by ikegami (Patriarch) on Oct 02, 2008 at 02:13 UTC | |
|
Re: Populating an Array of hash's
by chrism01 (Friar) on Oct 01, 2008 at 06:34 UTC |