| 1 | package UNIVERSAL::Object::ID; | ||
| 2 | |||
| 3 | 2 | ▶ | use 5.008_008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | ▶ | use version; our $VERSION = qv("v0.1.2"); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | { | ||
| 11 | package UNIVERSAL; | ||
| 12 | 2 | ▶ | use Object::ID; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | } | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | UNIVERSAL::Object::ID - Supply a unique object identifier to every object | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | use DateTime; # for example | ||
| 22 | use UNIVERSAL::Object::ID; | ||
| 23 | |||
| 24 | my $date = DateTime->now; | ||
| 25 | |||
| 26 | print $date->object_id; | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | Loading UNIVERSAL::Object::ID makes the C<< Object::ID >> role | ||
| 31 | available to every object. | ||
| 32 | |||
| 33 | Use at your own risk, polluting UNIVERSAL is not to be taken lightly. | ||
| 34 | The best place to use this module is in your own personal or internal | ||
| 35 | use code rather than a widely distributed software library. Or you | ||
| 36 | can use L<Method::Lexical> to safely apply the UNIVERSAL effect to | ||
| 37 | just your lexical scope. | ||
| 38 | |||
| 39 | =head1 SEE ALSO | ||
| 40 | |||
| 41 | L<Object::ID>, L<Method::Lexical> | ||
| 42 | |||
| 43 | =cut | ||
| 44 | |||
| 45 | 2 | 1; | |