Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: unique data in dynamic hash

by thor (Priest)
on Nov 15, 2005 at 22:39 UTC ( [id://508831]=note: print w/replies, xml ) Need Help??


in reply to unique data in dynamic hash

Unless I'm missing something, each testcase will have an array of hashes stored at that location. Each testcase will be unique with respect to that. Is this not what you want?

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^2: unique data in dynamic hash
by rsennat (Beadle) on Nov 15, 2005 at 22:47 UTC
    Hi thor,
    right. testcase will be unique. but the array of hashes gets appended again and again.
    how to maintain uniqueness with the data in the array elements.

    also one more question here, how to push hashes to each testcase.

      Well...you are using the push function and an array. If you want only one thing to be stored at that location, you'll want something like (untested):
      $hoh{$component}{$cmd}{$testcase} = { testsuite_type => $testsuite_type, platform_type => $platform_type, view => $view_type }

      thor

      Feel the white light, the light within
      Be your own disciple, fan the sparks of will
      For all of us waiting, your kingdom will come

        this worked for me.

        thanks a lot.
        rsennat

      Show us what you want to achieve. Something like this:

      use warnings; use strict; use Data::Dumper; my %hoh; while (<DATA>) { my @items = split ' '; push @{$hoh{'this'}->{'that'}->{'theOther'} }, [@items]; } print Dumper (\%hoh); __DATA__ eggs bacon cheese tomatoes potatoes onions beans peas cabbage

      Perl is Huffman encoded by design.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://508831]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-16 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found