#!/usr/bin/perl -w use strict; my %test_hash; $test_hash{'a'}{'b'}{'c'}{'d'} = "Yay"; print get_id("a.b.c.d"), "\n"; sub get_id { my @parts = split /\./, $_[0]; # Currently written to access a global hash return $test_hash{$parts[0]}{$parts[1]}{$parts[2]}{$parts[3]}; }