Attribute::Static - implementing static method with attributes
package Foo; use Attribute::Static; sub new { my $class = shift; bless {}, $class; } sub bar : Static { my $class = shift; } Foo->bar; # OK my $foo = Foo->new; $foo->bar; # NG
Attribute::Static implements something like static methods in Java.
sub foo : Static { }
must be called without instance.
Attribute::Handlers
Jiro Nishiguchi <jiro@cpan.org>
Copyright (C) 2005 by Jiro Nishiguchi
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Attribute::Static, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attribute::Static
CPAN shell
perl -MCPAN -e shell install Attribute::Static
For more information on module installation, please visit the detailed CPAN module installation guide.