sub found_char { my ($ex, $str) = @_; if ($ex->in_element('link') && $ex->within_element('item')) { print "\t\tLink: $str\n"; } }