#!/usr/bin/perl -w use strict; use diagnostics; my %hash; %hash = ( 1 => { ONE => "testdir", TWO => "tmpdir" }, 2 => { LOCATIONA => "$hash{1}{ONE}/$hash{1}{TWO}/my_file.txt", LOCATIONB => "$hash{1}{TWO}/$hash{1}{ONE}/my_file.txt" } ); print "$hash{2}{LOCATIONA} = location a\n"; print "$hash{2}{LOCATIONB} = location b\n";