#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; my @a = ('rev','test','neko'); my $b = 1; foreach my $d (@a){ $b = {$d => $b}; } warn Dumper $b;