in reply to Printing first element of an array in worksheet
Look at this line:
@redi = $responsetextall[$i][$j]{set}{Client}{redirect_uris}
What does $responsetextall[$i][$j]{set}{Client}{redirect_uris} contain? Does it contain an array reference? You are assigning that array reference to @redi so that @redi contains:
@redi = ( [....], );
It contains a single element. That element is a reference to an array. You should have done one of two things. Either this:
@redi = @{$responsetextall[$i][$j]{set}{Client}{redirect_uris}}
...or this:
$redi = $responsetextall[$i][$j]{set}{Client}{redirect_uris} # and then... for my $i (0..$#$redi) { $worksheet->write($r, 6, [$redi->[$i]]); }
The first one is an easier change, the second one is a little more memory efficient.
See perlreftut, and perllol, perhaps.
Dave
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Printing first element of an array in worksheet
by chandantul (Scribe) on Dec 09, 2020 at 19:47 UTC | |
by davido (Cardinal) on Dec 10, 2020 at 16:48 UTC | |
by chandantul (Scribe) on Dec 11, 2020 at 02:11 UTC | |
by choroba (Cardinal) on Dec 11, 2020 at 11:13 UTC | |
by chandantul (Scribe) on Dec 12, 2020 at 01:33 UTC |
In Section
Seekers of Perl Wisdom