use Data::UUID; use constant IDGenerator => Data::UUID->new(); sub new_sid { IDGenerator->create() }