in reply to Re: Having trouble looping through a data structure
in thread Having trouble looping through a data structure

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]; }

Replies are listed 'Best First'.
Re^3: Having trouble looping through a data structure
by moritz (Cardinal) on May 16, 2010 at 17:03 UTC
    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.