2013-04-11 01:07:29 -07:00
|
|
|
class Singleton {
|
|
|
|
|
# We create a lexical variable in the class block that holds our single instance.
|
2014-04-02 16:56:35 +00:00
|
|
|
my Singleton $instance = Singleton.bless; # You can add initialization arguments here.
|
2013-04-11 01:07:29 -07:00
|
|
|
method new {!!!} # Singleton.new dies.
|
|
|
|
|
method instance { $instance; }
|
|
|
|
|
}
|