in reply to Having trouble looping through a data structure

Try
print $data->{article}[0]{SKU}[0];
You can access all the entries this way. You should read perlref to understand what's going on.

Replies are listed 'Best First'.
Re^2: Having trouble looping through a data structure
by DreamT (Pilgrim) on May 16, 2010 at 16:57 UTC
    I can reach them like that without problems. I may have described my purpose in a bad way:-)
    I can put it like this, I want to find out how many articles there are, so that I loop through them. I.e, I want to be able to do this:
    loop over each article, how?? { print $data->{article}[i]{SKU}[0]; }
      for my $article (@{$data->{article}}) { print $article->{SKU}[0]; }

      I recommend perlreftut, it's easier to read and understand for the not-so-experienced.

      Perl 6 - links to (nearly) everything that is Perl 6.
        Thank you, worked very good!:) I will look att perlreftut.