Variable::Declaration - declare with type constraint
use Variable::Declaration; use Types::Standard '-all'; # variable declaration let $foo; # is equivalent to `my $foo` static $bar; # is equivalent to `state $bar` const $baz; # is equivalent to `my $baz;dlock($baz)` # with type constraint # init case let Str $foo = {}; # => Reference {} did not pass type constraint "Str" # store case let Str $foo = 'foo'; $foo = {}; # => Reference {} did not pass type constraint "Str"
Variable::Declaration provides new variable declarations, i.e. `let`, `static`, and `const`.
`let` is equivalent to `my` with type constraint. `static` is equivalent to `state` with type constraint. `const` is equivalent to `let` with data lock.
Copyright (C) Kenta, Kobayashi.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Kenta, Kobayashi <kentafly88@gmail.com>
To install Variable::Declaration, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Variable::Declaration
CPAN shell
perl -MCPAN -e shell install Variable::Declaration
For more information on module installation, please visit the detailed CPAN module installation guide.