in reply to Re: Put multiple values as columns inside a hash
in thread Put multiple values as columns inside a hash

Hello

I'm so sorry, but I'm pretty new to programming, so I'm not exactly sure I got your full idea...

I'm not exactly letting the value decide what column/month it is...the value is actually the frequency of occurrence of the key in that month.

And when you say store the column/month/name inside the hash, you mean as the value of the hash? Or the key? I apologize for my ignorance, but I haven't the foggiest idea of how to go about that ><, since they're not exactly the values I need (the values I need are the frequencies of occurrence)

The last point about decimals is really interesting though :) In the end, I'm going to input the information into an excel file and plot graphs using the data, so this can come into good use :)

Thank you so much for your helpful input! :D

Best Regards

Buzzybee

  • Comment on Re^2: Put multiple values as columns inside a hash

Replies are listed 'Best First'.
Re^3: Put multiple values as columns inside a hash
by aquarium (Curate) on Jun 25, 2010 at 04:13 UTC
    sorry for getting back to you late. what i mean is either you need to make the month part of the hash, e.g. assign explicitly $muteperc{$accession}{'month'} = whichever_month_need_to_assign. then when you're doing the output you can easily detect missing month or implicitly show (by printing month). Hope this makes sense.
    in the past i've written a perl report that adds up summary data values, with many different slices of summary results required per month and quarter. rather than counting on particular month data being present, the final output routine was a for(1..12) that indexed into the convoluted hashes by month number. Whatever month indexed values didn't exist (no data) i made sure undef printed as zero.
    on something related in doing summary calculations, can't remember what perl does when you divide by zero...but it ends up being a error with live data when values are missing or contain zero. so always put in an explicit check for divide by zero, before it bites.
    have fun perl coding.
    the hardest line to type correctly is: stty erase ^H