* Test for the existance of $p in Debbugs::User::get_user and return
if the file doesn't exist; if the file does exist and we can't read
it, die with an informative error message.
use base qw(Exporter);
BEGIN {
- ($VERSION) = q$Revision: 1.3 $ =~ /^Revision:\s+([^\s+])/;
+ ($VERSION) = q$Revision: 1.4 $ =~ /^Revision:\s+([^\s+])/;
$DEBUG = 0 unless defined $DEBUG;
@EXPORT = ();
my $uf;
$user->{"filename"} = $p;
- open($uf, "< $p") or bless $user, "Debbugs::User";
+ if (not -r $p) {
+ return bless $user, "Debbugs::User";
+ }
+ open($uf, "< $p") or die "Unable to open file $p for reading: $!";
if ($need_lock) {
flock($uf, LOCK_EX);
$user->{"locked"} = $uf;