| MooseX-Method documentation | Contained in the MooseX-Method distribution. |
MooseX::Method::Constant - Constant generator for MooseX::Method
This API is unstable, it may change at any time. This should not affect ordinary MooseX::Method usage.
use MooseX::Method::Constant; my $constant = MooseX::Method::Constant->make; print eval "$constant";
Primarily used within the inlining compiler suite of MooseX::Method, and there are no guarantees this won't be gone tomorrow.
Makes a constant.
Most software has bugs. This module probably isn't an exception. If you find a bug please either email me, or add the bug to cpan-RT.
Anders Nor Berle <debolaz@gmail.com>
Copyright 2007 by Anders Nor Berle.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| MooseX-Method documentation | Contained in the MooseX-Method distribution. |
package MooseX::Method::Constant; use Moose; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:BERLE'; our $count; sub make { my ($class,$value) = @_; $count++; no strict qw/refs/; *{"$class\::constant_$count"} = sub () { $value }; return "$class\::constant_$count()"; } 1; __END__