On Thu, Nov 15, 2012 at 2:46 AM, jet speed > ... > I was able to build the hash, however the file contains approx 10,000 > entries. but while i print the hash i get only approx 1300 lines or > key=>values. > > i guess its because, the file has duplicate entries. example below > > file.txt >> ---------------- >> > 22:5a => 10.00.00.00.aa.56.9b.7a > 22:5a => 10.00.00.00.aa.57.99.8a > 32:9c => 10.00.00.00.aa.46.9b.33 > a2:cc => 10.00.00.00.aa.5a.9b.63 > a5:cc => 10.00.00.00.aa.5a.9b.63 > b2:cc => 10.00.00.00.aa.5a.9b.63 > > How do i build all the entries into hash including the duplicates on both > sides keys and values.
One possible way: DB_File has a BTREE file type (with the R_DUP setting and the 'seq' API method) that enables storing/retrieving dup's. There's a full example in the docs. See: perldoc DB_File. -- Charles DeRykus -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/