Hello All, My code has worked before but i could not able to figure out the reason its not working now. I have Array reference and that i am pushing by following:

push @responsetextall, @responsetext;
but while i am trying to loop 2nd time its complaining about the following line:
for my $j (0..$#{$responsetextall[$i]}) {
Please check below code and advise the probable solution on this.

run_api_call($urlstringapp); @responsetext = parse_json ($client->responseContent()); push @responsetextall, @responsetext; $linkheader = $client->responseHeader("Link"); print $linkheader; if ($linkheader=~ m/next/) { (my $link1 = $linkheader) =~ s/ .*? (self)/$1/gx; (my $link2 = $link1) =~ s/self/$1/g; (my $link3 = $link2) =~ s/</$1/g; (my $link4 = $link3) =~ s/>/$1/g; (my $link5 = $link4) =~ s/;/$1/g; (my $link6 = $link5) =~ s/ /$1/g; (my $link7 = $link6) =~ s/=\"/$1/g; (my $link8 = $link7) =~ s/relnext/$1/g; (my $link9 = $link8) =~ s/"/$1/g; (my $link10 = $link9) =~ s/,/$1/g; print $link10; #print $link10; #$linkheader =~ s/next/$1/g; $urlstringapp = $link10; #print $urlstringapp; #break(); #print $linkheader; } } while ($linkheader=~ m/next/); #print @responsetextall; for my $i (0..$#responsetextall) { ## for my $i (0..@$responsetextall) { # for my $i (@responsetextall) { #print Dumper @responsetextall; $responsetextall[$i] =~ s/]\[/,/g; #print Dumper @responsetextall; ## for my $j (0..$#{$responsetextall[$i]}) { for my $j (0..$#{$responsetextall[$i]}) { # for my $j (@$responsetextall) { my $responseid = $responsetextall[$i][$j]{id}; my $responsests = $responsetextall[$i][$j]{status}; #$responselastlogin = $responsetextall[$i][$j]{lastLogin};

In reply to Not an ARRAY reference by chandantul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.