![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Referencing/returning array of hashes from subby PoGGiE (Initiate) |
on Jun 08, 2011 at 17:45 UTC ( #908753=perlquestion: print w/replies, xml ) | Need Help?? |
PoGGiE has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm having a problem referencing/returning my hash arrays and thought I would ask here ... I've been stuck on this for 2 days already trying to read/understand perldocs etc.! pretty new to Perl so apologies if this is a super-n00b question. I'm trying to pass an array of hash arrays to-and-from a sub. E.g. : $F_SCORE$i{$co})where $i is the year counter, and $co is a company name string. My basic code is this: At end of sub: return (\@date, \@F_SCORE, \@F_SCORE_BOX, \@F_ROA, \@F_CFO, \@F_dROA, \@F_ACCRUAL, \@F_dLEVER, \@F_dLIQUID, \@F_EQOFFER, \@F_dTURN, \@F_dMARGIN); then in main:
Confusingly for me, $date prints each element just fine, whereas none of the others seem to contain any data (that I have find). In the sub itself, they work fine and I can dump F_Score (and other) values to the screen. Kinda stumped and thought some kind soul here might have an idea! (I'm sure there is a better way to do this too ... I'm all ears!) Thanks, Carl
Back to
Seekers of Perl Wisdom
|
|