What is the correct implementation of singleton pattern in perl6?
I've tried this but I dont' know how to use static keyword in perl6:
It one of the few reasons that require using bless
method
class Singleton {
my Singleton $instance;
method new {!!!}
submethod instance {
$instance = Singleton.bless unless $instance;
$instance;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With