#! /usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash; my $w = 1; for $v (0..3){ $hash{$w} = $v; $w++; } print Dumper(\%hash);