use warnings; use strict; my @fields = ( 'temperature in Celsius', 'relative humidity in %', 'pressure in millibars %', 'dewpoint in degrees Celsius', 'total column ozone in Dobson Units', ); my @values = qw ( 23 56 1008.1 4 344 ); my %hash; @hash{@fields} = @values; # Print the whole thing: print "$_: $hash{$_}\n" for keys %hash; # Print one element: print $hash{'temperature in Celsius'};