steph_bow has asked for the wisdom of the Perl Monks concerning the following question:
Hello Dear Monks
I am usin a hash reference in my program but I made a mistake. Could you check ? Thanks. I just wrote the parts where the problem lies. I have not written what has been tested.
I have updated the code with bits I found important to write
sub flow_count{ my $HASH_OF_FLOW; my $view = $_[0]; # FTFM or CTFM ... ... foreach my $file(@FILES_IN_THE_FOLDER){ my $key = "$reg;$date"; # M2 is a number which has been computed $HASH_OF_FLOW->{'$key'} = 'M2'; } return $HASH_OF_FLOW; } my $FTFM_HASH_OF_FLOW = flow_count("FTFM"); my $CTFM_HASH_OF_FLOW = flow_count("CTFM"); my @FTFM_KEYS = keys %$FTFM_HASH_OF_FLOW; foreach my $key(@FTFM_KEYS){ my $FTFM_CTFM_diff = $FTFM_HASH_OF_FLOW{$key} - $CTFM_HASH_OF_FLOW +{$key}; print $OUTFILE "$key;$FTFM_HASH_OF_FLOW{$key};$CTFM_HASH_OF_FLOW{$ +key};$FTFM_CTFM_diff\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reference of hash
by toolic (Bishop) on Jun 13, 2008 at 13:56 UTC | |
|
Re: reference of hash
by radiantmatrix (Parson) on Jun 13, 2008 at 14:52 UTC |