Hello, I am new here and noob to Perl too, I would like to ask for some help.

I have this piece of code(I think the full program is not necessary for the matter discused):

my $data=  (Dumper $res->valueof('//listPhoneByNameResponse/return/phone'));

That part of the program brings the following output:

$VAR1 = { 'model' => 'Cisco 7911', 'name' => 'SEP00229004C80A', 'product' => 'Cisco 7911' }; $VAR2 = { 'model' => 'Cisco 7911', 'name' => 'SEP00229004C851', 'product' => 'Cisco 7911' }; $VAR3 = { 'model' => 'Cisco 7911', 'name' => 'SEP00229004CC92', 'product' => 'Cisco 7911'

I need to parse the output, to create a table. I could make a new program and process all the anonymous hashes, but is there a way to tell the "Dumper" function to bring only one value a time?

Something like this:

 print Dumper->${$VAR1}{"model"}; I think you got the idea. Any recomendation to parse a Data::Dumper output would be welcome. Thanks! I just want to say thank you all for your worthfull help. I just forgot about the Dumper module and made some modifications. At the end I just used the Text::Table module for practical purposes and it worked like a charm. Thanks again!

In reply to Help with Dumping data. Manipulate hashes output. by oldwarrior32

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.