Perl Singleton Objects

This is a quick introduction to perl Singleton objects.
A singleton object is an object that is only instantiated
once throughout an application.

Singleton Uses

Singletons can be used for many things. If you only want one
database connection for a particular application, or a limited
number of connections a singleton database class can handle
managing your open connections.

How to implement

The following is an example of how to put together a
database object that opens a database connection and returns
an existing connection to the caller.This allows your userid/password
to be set in a single location as well. You don't have to have every
piece of code that accesses the database use userid/password. Just use the
DBConnector object and then issue your database calls.

Although I was aware of the concept of such an object, I was unfamiliar with the term. Forgive my lack of knowledge in the ways of objects and OO, but isn't that similar to class values?

You suggest that such an object can be used for limiting connections, for example, but did not mention how. Would you simply set a flag variable to say if or how many connections were in use? If that is so, how would you handle concurrent attempts, or attempt to prevent race conditions?

My thanks to you for the instruction of your posting, as well also to those who commented.