P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your due diligence includes validating assumptions (sometimes just peppering code with print and print Dumper statements), and taking the time to understand the solutions presented. I mentioned in the original post that I assumed that $responsetextall[$i][$j]{set}{Client}{redirect_uris} contained an array reference. You could confirm that like this:
Which should print:
If it doesn't, your question was misleading. That's fine. If you use Data::Dumper you should be able to get better insight into what your data structure actually looks like:
If the output to that is anything besides an array ref, you'll have to adjust how you're unpacking it later on. I composed the following test to verify that my solution works as intended (after removing the in, which must have sneaked in from some recent Python work):
The output is:
So it is working, and is printing more than a single element. Also, your for loop is not the Perl way of doing things. If you don't need to care about the index, just iterate over the list:
Nicer, right? Please look at perlref, perlreftut, and the REFERENCES section of perlcheat for additional information on how to manipulate references. perlsyn and perlintro should have more discussion on for or foreach loops. Dave In reply to Re^3: Printing first element of an array in worksheet
by davido
|
|