UNIVER...ect::ID(3pm)

πŸ“¦
version 0.1.2 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– UNIVERSAL::Object::ID πŸ’–

okay bestie, so the page you're reading is literally titled UNIVER...ect::ID(3pm) β€” yes, the terminal cut it off like that, she's dramatic πŸ’… β€” and underneath all that abbreviation it's UNIVERSAL::Object::ID, living in the User Contributed Perl Documentation. And it does exactly one absurd little thing: it gives every object a unique identifier. every single one. no cap. πŸ‘‘


✨ NAME ✨

UNIVERSAL::Object::ID β€” supply a unique object identifier to every object πŸ¦‹


🌸 SYNOPSIS 🌸

use DateTime;  # for example
use UNIVERSAL::Object::ID;

my $date = DateTime->now;

print $date->object_id;

like… that's it. you load one module and suddenly your DateTime object is out here knowing its own object_id. iconic behavior, honestly. πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

The way this works is: loading UNIVERSAL::Object::ID makes the Object::ID role available to every object. not some objects. not your objects. every object. 🫢

⚠️ bestie, use at your own risk β€” polluting UNIVERSAL is not to be taken lightly. this is a big deal and you should treat it like one. πŸ’€

The best place to use this module is in your own personal or internal use code, rather than in a widely distributed software library. basically: keep it in-house, don't ship it to the whole world. 🏠✨

Or!! you can use Method::Lexical to safely apply the UNIVERSAL effect to just your lexical scope. so the chaos is contained, which is lowkey the responsible main character move. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • Object::ID
  • Method::Lexical

and that's the whole page, bestie 🌈

cute little sign-off: this was served up courtesy of perl v5.36.0, dated 2022-06-16, and stamped with the same abbrev'd UNIVER...ect::ID(3pm) energy it started with. mwah. πŸ˜­πŸ’œ

πŸ“¦ where this page comes from