X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=inline;f=perl%2FDXUser.pm;h=c84598afad795680582b5fab55d9ccbff9a99567;hb=8ac487c0c3297023df07493b11fe166d4c857081;hp=810bb7682d85c7f752249b013b2ef8ff3909fc81;hpb=584783d0ee480f9f56c167fc2e2aec280ba5e897;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 810bb768..c84598af 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -73,10 +73,15 @@ sub AUTOLOAD # sub init { - my ($pkg, $fn) = @_; + my ($pkg, $fn, $mode) = @_; confess "need a filename in User" if !$fn; - $dbm = tie (%u, MLDBM, $fn, O_CREAT|O_RDWR, 0666) or confess "can't open user file: $fn ($!)"; + if ($mode) { + $dbm = tie (%u, MLDBM, $fn, O_CREAT|O_RDWR, 0666) or confess "can't open user file: $fn ($!)"; + } else { + $dbm = tie (%u, MLDBM, $fn, O_RDONLY) or confess "can't open user file: $fn ($!)"; + } + $filename = $fn; }