Hi ravi45722,

I was just about to post asking what you want your output to look like, but you just edited your post to add the expected output. Have a look at How do I change/delete my post?, especially "It is uncool to update a node in a way that renders replies confusing or meaningless".

In addition to what others have said about your creation of the data structure, regarding your expected output: Interestingly, your code does produce the output you expect:

$VAR1 = [ 'term', { 'column08' => 'Submit' }, 'term', { 'column10' => 'Delivered' }, 'term', { 'column09' => 'Something' } ];

This is equivalent to your expected output, which uses the arrow operator (aka "fat comma") after 'term'. But because @return_array is an array and not a hash, I'm pretty sure you'll never get Data::Dumper to output the fat comma between some of its elements. Are you confusing an array and a hash? Maybe you could show how you later want to look things up in @return_array? Also you'll probably want to review perlreftut and perldsc in detail.

Hope this helps,
-- Hauke D


In reply to Re: Assign a hash to an array by haukex
in thread Assign a hash to an array by ravi45722

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.