Anonymous user
Singleton: Difference between revisions
m
→{{header|Perl 6}}: syntax update
(Added zkl) |
m (→{{header|Perl 6}}: syntax update) |
||
Line 1,250:
<lang Perl6>class Singleton {
# We create a lexical variable in the class block that holds our single instance.
my Singleton $instance = Singleton.bless
method new {!!!} # Singleton.new dies.
method instance { $instance; }
|