Hi, Now getting: Global symbol "%perl" requires explicit package name using $perl{issues} or $perl{issues}[0]{fields}. It seems that the type for the assignment of JSON::XS::decode_json $json is not a hash? Any other way to get the values? Thanks content of eg.json:
{"expand":"names,schema","startAt":0,"maxResults":50,"total":1,"issues +":[{"expand":"operations,versionedRepresentations,editmeta,changelog, +transitions,renderedFields","id":"569825","self":"https://example.com +/rest/api/2/issue/569825","key":"TEST-10756","fields":{"summary":" Au +tomated Testing","issuetype":{"self":"https://example.com/rest/api/2/ +issuetype/10100","id":"10100","description":"","iconUrl":"https://exa +mple.com/secure/viewavatar?size=xsmall&avatarId=26414&avatarType=issu +etype","name":"Auto Testing","subtask":false,"avatarId":26414},"custo +mfield_11150":{"self":"https://example.com/rest/api/2/customFieldOpti +on/11347","value":"Yes","id":"11347"},"customfield_11780":[{"self":"h +ttps://example.com/rest/api/2/customFieldOption/12841","value":"Sunda +y","id":"12841"},{"self":"https://example.com/rest/api/2/customFieldO +ption/12842","value":"Monday","id":"12842"},{"self":"https://example. +com/rest/api/2/customFieldOption/12843","value":"Tuesday","id":"12843 +"},{"self":"https://example.com/rest/api/2/customFieldOption/12844"," +value":"Wednesday","id":"12844"},{"self":"https://example.com/rest/ap +i/2/customFieldOption/12845","value":"Thursday","id":"12845"},{"self" +:"https://example.com/rest/api/2/customFieldOption/12846","value":"Fr +iday","id":"12846"},{"self":"https://example.com/rest/api/2/customFie +ldOption/12847","value":"Saturday","id":"12847"}],"customfield_22380" +:"2016-02-20","customfield_22181":"Jira TEST-10756 Automated Testing" +,"customfield_11179":"2015-12-11","updated":"2016-01-06T14:15:14.000- +0500","status":{"self":"https://example.com/rest/api/2/status/10034", +"description":"","iconUrl":"https://example.com/images/icons/statuses +/generic.png","name":"ProdStaged","id":"10034","statusCategory":{"sel +f":"https://example.com/rest/api/2/statuscategory/4","id":4,"key":"in +determinate","colorName":"yellow","name":"In Progress"}}}}]}
use strict; use warnings; use Benchmark qw( cmpthese timethese ); our $VERSION = '1.00'; my $wanttime = $ARGV[1] || 5; use JSON qw( -support_by_pp -no_export ); # for JSON::PP::Boolean inhe +ritance use JSON::XS (); my $json = <>; my perl = JSON::XS::decode_json $json; print Dumper $perl{issues} #get Global symbol "%perl" requires explic +it package name print Dumper $perl{issues}[0]{fields} #get Global symbol "%perl" requi +res explicit package name print Dumper @$perl{issues} prints output as in original post in VAR1.

In reply to Re^2: Getting specific field values from JIRA rest/api output using JSON::XS and array of hashes by Anonymous Monk
in thread Getting specific field values from JIRA rest/api output using JSON::XS and array of hashes by Anonymous Monk

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.