I have a 150k line file that I am trying to convert to a hash.
Each line has a number, e.g. first line has 50000000, last line has 50149999
The message I get is basically, I am running of shared memory.
Here is the code:
use IPC::Shareable;
%ShmOptions = ('create' =>1, 'exclusive' =>0, 'mode' =>0666, 'destroy'
=>0);
eval {tie(%hashofGuids, 'IPC::Shareable', 'hashguid', %ShmOptions}) };
my guidfile ='/home/gregk/www/guid_excluded.dat';
open(GUIDS, guidfile) or die "couldn't open file: $!";
(tied %hashofGuids)->shlock;
while(<GUIDS>)
{
chomp($eachline = $_;
$hashofGuids{$eachline} = 1;
}
(tied %hashofGuids)->shunlock;
## At this point I get the running out of shared memory message ###
I tried used size=>xxx in the %ShmOptions statement but I get an invalid
size error message.
I am open to any suggestions,
thanx,
greg
"WC -Sx- Jones" < > wrote in
message news:...
> SpecialK wrote:
> > Does anyone know how to tie a large existing file(each record is a 8byte
> > number) to a Hash using IPC::Shareable?
> > Any Code fragments would be most helpful.
>
> Why doesnt:
>
> http://search.cpan.org/~bsugars/IPC-...C/Shareable.pm
>
> Address your question?
> -Sx-
>
> PS - See also:
> http://london.pm.org/pipermail/londo...18/020948.html