#!/usr/bin/perl -w use strict; my $hash = {'MONTH' => 'January'}; print $hash->{MONTH} . "\n"; my $string = q('MONTH' => 'January'); #from file # I split your original string, but there probably is a cleaner # way from your file read my @split = split / => /, $string; s/'//g for @split; print "@split\n"; my $hash1->{ $split[0] } = $split[1]; print $hash1->{MONTH} . "\n";