MouseX...tructor(3pm)

πŸ“¦
version 0.02 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

MouseX::StrictConstructor β€” bestie, this makes your object constructors blow up on unknown attributes πŸ’₯ no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

use Mouse;
use MouseX::StrictConstructor;

that's literally it. two lines. iconic.


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: just loading this module makes your constructors "strict". that's the whole vibe. you don't call anything, you don't configure anything, you just use it and it's giving locked-in ✨

and then β€” if your constructor gets called with an attribute argument that your class does not declare? it dies. like, immediately. no chill, no mercy, just death πŸ’€

and honestly? that's a feature. it's a great way to catch small typos πŸŽ€ like bestie you typed nmae instead of name and now your object is silently broken for three hours. not anymore. the constructor said "we don't do that here" and ended it. main character energy honestly πŸ‘‘


πŸ› BUGS πŸ›

all complex software has bugs lurking in it, and this module is no exception πŸ₯² like every icon has a hater, every codebase has a bug.

if you find a bug, please either email me, or add the bug to cpan-RT. that's it, that's the ask 🫢


🌸 SEE ALSO 🌸

  • Mouse
  • Moose
  • MooseX::StrictConstructor

πŸ‘‘ AUTHOR πŸ‘‘

Fuji, Goro (gfx) <gfuji(at)cpan.org>


Copyright (c) 2010, Fuji, Goro (gfx). All rights reserved.

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


k bye bestie, go forth and make your constructors strict πŸ’… this was the User Contributed Perl Documentation page for MouseX::StrictConstructor, chillin' under perl v5.36.0 and dated 2022-12-11 πŸŽ€βœ¨

πŸ“¦ where this page comes from