The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Unique

Unique id

PhilipRBrenan@yahoo.com, 2004, Perl license

Synopsis

#example t/unique.t

Description

Returns a unique id each time it is called.

 package unique;
 use Carp;
 

Constructors

unique

Return new unique id

 my $unique = 0;
 
 sub unique() {++$unique}
 

new

Return new unique id, synonym for "unique"

 sub new {unique()}
 

Exports

Export "unique"

 use exports qw(
   unique ()
  );
 
 #_ Unique _____________________________________________________________
 # Package loaded successfully
 #______________________________________________________________________
 
 1;