sub whereami { my $self = shift; $self->{parent}->locate($self); } # in Parent sub locate { my $self = shift; my $child = shift; foreach my $x (0 .. $xmax) { foreach my $y (0 .. $ymax) { return ($x, $y) if $self->{children}[$x][$y] eq $child; } } }