use YAML qw/Dump LoadFile/; my $nav = LoadFile('nav.yaml'); print $nav->to_html; print $nav->selected_to_html('foo');