in reply to Re: Accessing this array ref.
in thread Accessing this array ref.

This would do it, I could combined all the data into one variable and print at once instead of printing them in the IF, right?

Replies are listed 'Best First'.
Re^3: Accessing this array ref.
by Cristoforo (Curate) on Apr 03, 2013 at 19:52 UTC
    I don't understand your question. If the data is sorted as Loops said, his solution should work for you.
      I am sorry, is that at the end of processing I have to pass the values as this:
      $template->param('data', $results);
        my $results; my $type; for my $entry (@$VAR1) { if ( $entry->{type} ne $type ) { $type = $entry->{type}; push @$results, "$type\n"; } push @$results, "\t$entry->{name} - $entry->{reference}\n"; }
        Then this should do it.