1Role::Commons::ObjectIDU(s3e)r Contributed Perl DocumentaRtoiloen::Commons::ObjectID(3)
2
3
4
6 Role::Commons::Authority - an object method providing a unique
7 identifier
8
10 use v5.14;
11
12 package Person 1.0 {
13 use Moo;
14 use Role::Commons -all;
15 has name => (is => 'ro');
16 };
17
18 my $bob1 = Person->new(name => "Bob");
19 my $bob2 = Person->new(name => "Bob");
20
21 say $bob1->object_id; # an identifier
22 say $bob2->object_id; # a different identifier
23
25 This is a tiny shim between Object::ID and Role::Commons (and hence
26 Moo::Role/Moose::Role too).
27
29 Please report any bugs to
30 <http://rt.cpan.org/Dist/Display.html?Queue=Role-Commons>.
31
33 Role::Commons, Object::ID.
34
36 Toby Inkster <tobyink@cpan.org>.
37
39 This software is copyright (c) 2012, 2014 by Toby Inkster.
40
41 This is free software; you can redistribute it and/or modify it under
42 the same terms as the Perl 5 programming language system itself.
43
45 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
46 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
47 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
48
49
50
51perl v5.36.0 2023-01-20 Role::Commons::ObjectID(3)