#! perl -slw use strict; my $tree = { 'misc' => {}, 'docs' => { 'howtos' => { 'email' => { 'index.html' => { 'date' => '21-1-2004', 'size' => '691' } }, 'ftp' => {}, 'ssh' => {} } } }; sub find{ my( $href, $path ) = @_; $href = $href->{ $_ } for grep{ $_ } split '/', $path; $href; } my $input = '/docs/howtos/email/'; print find( $tree, $input )->{ 'index.html' }{ size };