Hello all. I have incorporated a DBM file into one of my programs. The
problem I am having is that I cannot store "" as a key in a DBM file. (if
so, it's not working here!) Anyways, here is a sample output from diff on 2
sets of program output. The first is where DBM is used, and the second is
where an in-memory hash is used. The second field of each line is the
frequency of the occurance of the first field. The fourth field is the
cumulative frequency. Everything adds up,  but the DBM version is missing
the 76 which had a key of "". Is there any way to get around this besides
recoding the value? The only differences in the programs is the use of DBM.
I have also included a diff output on the 2 perl scripts at the very bottom.
TIA. --Jess

Diff output on 2 outputs of the program:

1,12c1,13
< 0|257707|51.5414|257707|51.54|
< 1|133131|26.6262|390838|78.17|
< 10|3|0.0006|390841|78.17|
< 11|1|0.0002|390842|78.17|
< 2|64050|12.8100|454892|90.98|
< 3|29061|5.8122|483953|96.79|
< 4|11163|2.2326|495116|99.02|
< 5|3559|0.7118|498675|99.74|
< 6|961|0.1922|499636|99.93|
< 7|218|0.0436|499854|99.97|
< 8|62|0.0124|499916|99.98|
< 9|8|0.0016|499924|99.98|
---
> |76|0.0152|76|0.02|
> 0|257707|51.5414|257783|51.56|
> 1|133131|26.6262|390914|78.18|
> 10|3|0.0006|390917|78.18|
> 11|1|0.0002|390918|78.18|
> 2|64050|12.8100|454968|90.99|
> 3|29061|5.8122|484029|96.81|
> 4|11163|2.2326|495192|99.04|
> 5|3559|0.7118|498751|99.75|
> 6|961|0.1922|499712|99.94|
> 7|218|0.0436|499930|99.99|
> 8|62|0.0124|499992|100.00|
> 9|8|0.0016|500000|100.00|

Diff from 2 perl scripts: This illustrates the only difference is the use of
the DBM file. Everything else is the same.

5a6
> use DB_File;
82a84,85
> dbmopen( %freqidx, "/tmp/$$.db", 0666 ) or die( "Can't open temporary file
(/tmp/$$.db): $!\n" );
> 
115a119,122
> dbmclose( %freqidx ) or die( "Can't close temporary file (/tmp/$$.db):
$!\n" );
> 
> unlink( "/tmp/$$.db" ) or die( "Can't delete temporary file (/tmp/$$.db):
$!\n" );
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to