use strict; use warnings; my %something; my $key = "that's it!"; #contents from file foo.txt my $value = "foo"; #filename $something{$key} = $value; print $something{$key}; #### foo