Rose::Object(3pm)
π Rose::Object β the manual, but make it cute β¨
okay bestie, this is Rose::Object, a page from the User Contributed Perl Documentation collection π and honestly? it's giving "tiny but mighty." it's a simple object base class. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
Rose::Object β a simple object base class. yes bestie, that's it, that's the name, short and iconic π
πΈ SYNOPSIS πΈ
here's how you use it, copy-paste style, no cap:
package MyObject;
use Rose::Object;
our @ISA = qw(Rose::Object);
sub foo { ... }
sub bar { ... }
...
my $o = MyObject->new(foo => 'abc', bar => 5);
...
literally that's all you need to start being a main character with your own class π
π¦ DESCRIPTION π¦
so Rose::Object is a generic object base class. it does not come with a whole buffet of features β it provides very little functionality, but a healthy dose of convention π. and honestly? that's the point. lowkey minimal, highkey useful.
π METHODS π
π new PARAMS
constructs a new, empty, hash-based object based on PARAMS π
and what are PARAMS? they're name/value pairs, bestie. then it calls init (scroll down, it's right there π) and passes PARAMS to it unmodified β no edits, no notes, no touching, fr fr.
π init PARAMS
you hand it a list of name/value pairs in PARAMS, and it calls the object method of each name, passing the corresponding value along as an argument β¨
the methods get called in the order that they appear in PARAMS β order matters, periodt π
like, for example:
$o->init(foo => 1, bar => 2);
is equivalent to this exact sequence:
$o->foo(1);
$o->bar(2);
see? foo first, then bar. in that order. no skipping ahead π
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β thank you for your service, king π«Ά
π LICENSE π
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself πΈ
bestie, that's the legal bit β keep it, it's not optional π
and that's the whole page!! slay β¨ this was Rose::Object, from perl v5.34.0, dated 2022-05-28 π go forth and inherit responsibly, i love you, bye π¦ππ
π¦ where this page comes from
- debian bookworm: librose-object-perl 0.860-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: librose-object-perl 0.860-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librose-object-perl 0.860-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librose-object-perl 0.860-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librose-object-perl 0.860-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms