T
Tuc
Hi,
I seem to be running into some issues with tie in perl 5.8.8 with the
defined-or patch from the FreeBSD ports.
I use :
use NDBM_File;
use Fcntl;
I open up my file as :
tie (%fdb,'NDBM_File',"file.victims",O_RDWR|O_CREAT,0777) ||die $!;
I write to it as
$fdb{$_}="TUC";
I close it as :
untie %fdb;
Seems pretty basic. But I've got 2 issues.
1) If $_="Fred", and the program iterates and does
$fdb{'Fred'}="TUC"; , if I immediately start another program up to
read "Fred" from the file, it claims it doesn't exist. As if it hasn't
sync'd. As soon as I do the "untie %fdb;", then the data becomes
available. Is there a way that as soon as I $fdb{'Fred'}="TUC"; it
becomes accessible?
2) I also have the issue that if I'm running my program, and I hit
CNTRL-C to stop it, none of the values I've $fdb{$_}="TUC"; end up
getting and staying set. So the next time the program runs, and checks
to see if its already in the data store, it says its not and re-
executes the command. Is there some way that once its set its
"committed" per se?
Thanks, Tuc
I seem to be running into some issues with tie in perl 5.8.8 with the
defined-or patch from the FreeBSD ports.
I use :
use NDBM_File;
use Fcntl;
I open up my file as :
tie (%fdb,'NDBM_File',"file.victims",O_RDWR|O_CREAT,0777) ||die $!;
I write to it as
$fdb{$_}="TUC";
I close it as :
untie %fdb;
Seems pretty basic. But I've got 2 issues.
1) If $_="Fred", and the program iterates and does
$fdb{'Fred'}="TUC"; , if I immediately start another program up to
read "Fred" from the file, it claims it doesn't exist. As if it hasn't
sync'd. As soon as I do the "untie %fdb;", then the data becomes
available. Is there a way that as soon as I $fdb{'Fred'}="TUC"; it
becomes accessible?
2) I also have the issue that if I'm running my program, and I hit
CNTRL-C to stop it, none of the values I've $fdb{$_}="TUC"; end up
getting and staying set. So the next time the program runs, and checks
to see if its already in the data store, it says its not and re-
executes the command. Is there some way that once its set its
"committed" per se?
Thanks, Tuc