http://qs321.pair.com?node_id=313722


in reply to another 'array to hash' question

Normally doing this is not good practice. If you need the variable names, then you should most likely use a hash.

Here is an example of using an array to build a hash, which may help you, based on the title of your post.
#!/usr/bin/perl -w use strict; use Data::Dumper; my @keys = qw( fn ln age ); my @values = qw( Joe McCarty 89 ); my %hash; @hash{@keys} = @values; print Dumper \%hash;

- Tom