in reply to Re: Re: Hashes -- Core dump
in thread Hashes -- Core dump
use strict; use warnings; use DB_File; my $num_order_btree = new DB_File::BTREEINFO; $num_order_btree->{compare} = sub { $_[0] <=> $_[1] }; tie my %h, 'DB_File', 'test_tie.tmp', O_RDWR|O_CREAT, 0640, $num_order +_btree; while (<INPUT>){ $id = substr($_,9,11); unless (exists($h{$id})){ $h{$id} = $_; } else { } } while (defined ($_ = each %h)){ print OUTPUT $h{$_}; } untie %h;
|
|---|