Mail::...otLock(3pm)

πŸ’– Mail::Box::Locker::DotLock πŸ’–

heyyy bestie, welcome to Mail::...otLock(3pm) β€” this one lives in the User Contributed Perl Documentation section and honestly? it's giving tiny-but-mighty. it does one (1) job and it does it cutely. let's get into it πŸŽ€


✨ NAME ✨

Mail::Box::Locker::DotLock β€” lock a folder with a separate file. that's it. that's the whole brand. πŸ¦‹


🌸 INHERITANCE 🌸

family tree check, because we love a lineage moment:

  • Mail::Box::Locker::DotLock
    • is a Mail::Box::Locker
    • is a Mail::Reporter

so it's inheriting the whole squad's energy. slay. πŸ’…


⭐ SYNOPSIS ⭐

See Mail::Box::Locker

bestie the synopsis is literally a redirect. iconic behaviour, honestly. go read the parent page. πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the ::DotLock object locks the folder by creating a file with the same name as the folder, extended by .lock.

that's the whole trick!! you want the folder? you gotta make the little .lock friend first. no lock file, no entry. it's giving velvet rope at the club. πŸŽ€

Extends "DESCRIPTION" in Mail::Box::Locker.


πŸ’œ METHODS πŸ’œ

Extends "METHODS" in Mail::Box::Locker.


πŸ‘‘ Constructors πŸ‘‘

Extends "Constructors" in Mail::Box::Locker.

$class->new(%options)

Name of the file to lock. By default, the folder's name is extended with .lock. Improves base, see "METHODS" in Mail::Box::Locker.

here's the full menu of options, defaults included, no cap:

  • dotlock_file β€” defined in: (this class) β€” default: undef
  • expires β€” defined in: Mail::Box::Locker β€” default: 1 hour
  • file β€” defined in: Mail::Box::Locker β€” default: <folderfile>.lock
  • folder β€” defined in: Mail::Box::Locker β€” default: <C<undef>>
  • method β€” defined in: Mail::Box::Locker β€” default: 'DOTLOCK'
  • timeout β€” defined in: Mail::Box::Locker β€” default: 10

and now the lil explanation for each:

  • dotlock_file => $file β€” Alternative name for "file", especially useful to confusion when the multi locker is used.
  • expires => $seconds
  • file => $file
  • folder => $folder
  • method => $name|CLASS|\@names
  • timeout => $seconds|'NOTIMEOUT'

πŸ‘‘ Attributes πŸ‘‘

Extends "Attributes" in Mail::Box::Locker.

  • $obj->expires( [SECONDS] ) β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->filename( [$filename] ) β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->folder() β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->name() β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->timeout( [SECONDS] ) β€” Inherited, see "Attributes" in Mail::Box::Locker

all of these are inherited, so no new lore here, but we're keeping them listed because rules are rules πŸ’…


πŸ”’ Locking πŸ”’

Extends "Locking" in Mail::Box::Locker.

  • $obj->hasLock() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->isLocked() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->lock() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->unlock() β€” Inherited, see "Locking" in Mail::Box::Locker

the actual lock/unlock brainpower lives in the parent, so go read Mail::Box::Locker for the real tea. πŸ«–


😭 Error handling 😭

Extends "Error handling" in Mail::Box::Locker.

  • $obj->AUTOLOAD() β€” Inherited, see "Error handling" in Mail::Reporter
  • $obj->notImplemented() β€” Inherited, see "Error handling" in Mail::Reporter

🧹 Cleanup 🧹

Extends "Cleanup" in Mail::Box::Locker.

  • $obj->DESTROY() β€” Inherited, see "Cleanup" in Mail::Box::Locker

πŸ’€ DIAGNOSTICS πŸ’€

buckle up bestie, here's every single way this thing can yell at you:

  • Error: Dotlock requires a lock file name. Cast by folder()
  • Error: class $package does not implement method $method. Fatal error: the specific $package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by notImplemented()
  • Warning: couldn't remove lockfile $file: $! Cast by unlock()
  • Fault: failed to remove expired lockfile $file: $! Cast by lock()
  • Warning: folder already locked with file $file Cast by lock()
  • Fault: lockfile $file can never be created: $! Cast by lock()
  • Warning: removed expired lockfile $file Cast by lock()
🚨 the Fault lines are the serious ones β€” "failed to remove expired lockfile" and "lockfile can never be created" both mean something genuinely went wrong with your filesystem or perms, not just a lil oopsie. read them and actually do something about them, fr fr.

🌈 SEE ALSO 🌈

This module is part of Mail-Box version 4.02, built on April 10, 2026.

Website: http://perl.overmeer.net/CPAN/


πŸ“œ LICENSE πŸ“œ

For contributors see file ChangeLog.

This software is copyright (c) 2001-2026 by Mark Overmeer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie!! πŸ₯³ obligatory sign-off: this doc shipped as perl v5.40.1, dated 2026-05-09, page Mail::...otLock(3pm). go lock a folder, you absolute legend πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from