in reply to Using HTML Module

As I read it, the problem is that $temp_token->[1] will never be both 'item' and 'value' at the same time. Anything that passes the while condition can't pass the nested if. Here's one shot at it. I think this is more clear:
if ($item_name eq "Show Link") { my @elements; while ($temp_token = $p->get_token) { last if $temp_token->[0] eq 'E'; if (($temp_token->[0] eq "S") && ($temp_token->[1] eq "value" +)) { $temp_token = $p->get_tag("item"); push @elements, $p->get_trimmed_text('/item'); } $temp_token = $p->get_token; } $temp_dcr{$dcr_name}{Location} = \@elements; }
I may be misreading your logic, but it looks a little easier to me.