sub initrooms { my (@aa, %things, $b, @ar, $t, $de, $ex, $th, @a); open (RF, "rooms.txt") or die "could not open datafile: $!"; undef $/; @ar = split (/0/, ); $/ = "\n"; foreach (@ar) { ($t, $de, $ex, $th) = split /:/, $_; if ($th eq //) { next; } %things = split /-/, $th; print %things; (all elements present) push @a, { TITLE => $t, TEXT => $de, EXITS => $ex, THINGS => {%things} }; } return \@a; } sub lookat { my @i; my ($id, $i, $item); my ($tg, $cr, $aoa) = @_; if (exists ($aoa->[$cr]->{THINGS}->{$tg})) { print color("bold blue"), "\n", $aoa->[$cr]->{THINGS}->{$tg}, color("reset"); return; } print "\nHmm .. where?"; }