Commits

Anonymous committed 7c2dbcc

Removed assignments of the lists.

Comments (0)

Files changed (1)

XML-Grammar-Fortune/module/lib/XML/Grammar/Fortune/ToText.pm

     _mode
     _input
     _output
-    _fortunes_list
     _fortune
     _this_line
     ));
 
     my $xml = XML::LibXML->new->parse_file($self->_input());
 
-    $self->_fortunes_list(scalar($xml->findnodes("//fortune")));
-
     $self->_iter_over_elems_list(
-        $self->_fortunes_list(),
+        scalar($xml->findnodes("//fortune")),
         {
             process => sub {
                 $self->_fortune(shift);
         }
     );
 
-    $self->_fortunes_list(undef);
-
     return;
 }
 
 
     my ($body_node) = $play_node->findnodes("body");
 
-    my $portions_list = $body_node->findnodes("description|saying");
-
     $self->_iter_over_elems_list(
-        $portions_list,
+        scalar( $body_node->findnodes("description|saying") ),
         {
             process => sub {
                 # TODO : extract to a method.
 
     my $is_bullets = ($ul->localname() eq "ul");
 
-    my $items_list = $ul->findnodes("li");
-
     my $idx = 1;
 
     $self->_iter_over_elems_list(
-        $items_list,
+        scalar($ul->findnodes("li")),
         {
             process => sub {
                 my $li = shift;
 
     my $para_name = $args->{para_is};
 
-    my $paragraphs = $portion->findnodes($para_name);
-
     $self->_iter_over_elems_list(
-        $paragraphs,
+        scalar( $portion->findnodes($para_name) ),
         {
             process => sub {
                 my $para = shift;