GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MooX::Singleton(3) User Contributed Perl Documentation MooX::Singleton(3)

MooX::Singleton - turn your Moo class into singleton

version 1.20

    package MyApp;
    use Moo;
    with 'MooX::Singleton';

    package main;

    my $instance = MyApp->instance(@optional_init_args);
    my $same = MyApp->instance;

Role::Tiny role that provides "instance" method turning your object into singleton.

    my $singleton = MyApp->instance(@args1);
    my $same = MyApp->instance;
    # @args2 are ignored
    my $above = MyApp->instance(@args2);

Creates a new object initialized with arguments provided and then returns it.

NOTE: Subsequent calls to "instance" will return the singleton instance ignoring any arguments. This is different from MooseX::Singleton which does not allow any arguments.

Alex J. G. Burzyński <ajgb@cpan.org>

This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2013-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.