chandantul has asked for the wisdom of the Perl Monks concerning the following question:
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:
but while i am trying to loop 2nd time its complaining about the following line:push @responsetextall, @responsetext;
Please check below code and advise the probable solution on this.for my $j (0..$#{$responsetextall[$i]}) {
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};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not an ARRAY reference
by Fletch (Bishop) on Nov 06, 2020 at 18:23 UTC | |
|
Re: Not an ARRAY reference (updated)
by AnomalousMonk (Archbishop) on Nov 07, 2020 at 00:48 UTC | |
|
Re: Not an ARRAY reference
by BillKSmith (Monsignor) on Nov 06, 2020 at 23:49 UTC | |
by chandantul (Scribe) on Nov 07, 2020 at 05:52 UTC | |
|
Re: Not an ARRAY reference
by AnomalousMonk (Archbishop) on Nov 07, 2020 at 06:57 UTC | |
by chandantul (Scribe) on Nov 08, 2020 at 01:15 UTC | |
by roboticus (Chancellor) on Nov 08, 2020 at 15:09 UTC | |
by chandantul (Scribe) on Nov 08, 2020 at 16:52 UTC | |
by roboticus (Chancellor) on Nov 08, 2020 at 20:03 UTC | |
| |
|
Re: Not an ARRAY reference
by tobyink (Canon) on Nov 07, 2020 at 08:52 UTC | |
by BillKSmith (Monsignor) on Nov 07, 2020 at 21:13 UTC |