Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 7721
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: aa29 [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.057
Fixed in: (no value)



Subject: Mail::Box::init creates locker before directory is set up in Mail::Box::MH
Running perl -w -MMail::Box::MH -e "Mail::Box::MH->new(folder=>'.')" gives two warnings: Use of uninitialized value in transliteration (tr///) at C:/Perl/lib/File/Spec/Win32.pm line 99. Use of uninitialized value in pattern match (m//) at C:/Perl/lib/File/Spec/Win32.pm line 101. These caused by instantiating locker object in Mail::Box::init before 'MBD_directory' property is set in Mail::Box::Dir. Call stack: File::Spec::Win32::catdir('File::Spec','undef') called at C:/Perl/lib/File/Spec/Win32.pm line 90 File::Spec::Win32::catfile('File::Spec','undef') called at C:/Perl/site/lib/Mail/Box/Locker/DotLock.pm line 25 Mail::Box::Locker::DotLock::init('Mail::Box::Locker...','HASH(0x18f3d18)') called at C:/Perl/site/lib/Mail/Reporter.pm line 23 ^^^^ $folder->directory is used here, and it returns value of MBD_directory Mail::Reporter::new('Mail::Box::Locker...','timeout','undef','file','undef','method','undef','expires','undef',...) called at C:/Perl/site/lib/Mail/Box/Locker.pm line 50 Mail::Box::Locker::new('Mail::Box::Locker','folder','Mail::Box::MH=HAS...','method','undef','timeout','undef','expires','undef',...) called at C:/Perl/site/lib/Mail/Box.pm line 133 Mail::Box::init('Mail::Box::MH=HAS...','HASH(0x19ad08c)') called at C:/Perl/site/lib/Mail/Box/Dir.pm line 31 Mail::Box::Dir::init('Mail::Box::MH=HAS...','HASH(0x19ad08c)') called at C:/Perl/site/lib/Mail/Box/MH.pm line 29 ^^^^^^^ $self->{MBD_directory} is set here, _after_ $self->SUPER::init Mail::Box::MH::init('Mail::Box::MH=HAS...','HASH(0x19ad08c)') called at C:/Perl/site/lib/Mail/Reporter.pm line 23 Mail::Reporter::new('Mail::Box::MH','folder','c:/umka//xml/user...','folderdir','c:/umka//xml/user...','access','rw','create',1,...) called at C:/Perl/site/lib/Mail/Box.pm line 52 Mail::Box::new('Mail::Box::MH','folder','c:/umka//xml/user...','folderdir','c:/umka//xml/user...','access','rw','create',1,...) called at c:/umka/engine//Umka/Education/NewMail/Transport.pm line 33 Thanks.
You're right. I have fixed this by chaning in Mail::Box::Dir sub init() { ... my $directory = $self->directory; ... } sub directory() { my $self = shift; $self->{MBD_directory} ||= $self->folderToDirectory($self->name, $self->folderdir); }