#!/usr/bin/perl -w use strict; my $hash = {'MONTH' => 'January'}; print $hash->{MONTH} . "\n"; my $hashInitStr = "{'MONTH' => 'January'}"; # This would come from a file my $hash1 = $hashInitStr; print $hash1->{MONTH} . "\n" #### January Can't use string ("{'MONTH' => 'January'}") as a HASH ref while "strict refs" in use at ./anonHashfromStr.pl line 9.