3 Return::Type::Lexical - Same thing as Return::Type, but lexical
11 use Return::Type::Lexical;
12 use Types::Standard qw(Int);
14 sub foo :ReturnType(Int) { return "not an int" }
17 no Return::Type::Lexical;
18 sub bar :ReturnType(Int) { return "not an int" }
21 my $foo = foo(); # throws an error
22 my $bar = bar(); # returns "not an int"
24 # Can also be used with Devel::StrictMode to only perform
25 # type checks in strict mode:
27 use Devel::StrictMode;
28 use Return::Type::Lexical check => STRICT;
32 This module works just like [Return::Type](https://metacpan.org/pod/Return%3A%3AType), but type-checking can be enabled and disabled within
35 There is no runtime penalty when type-checking is disabled.
41 The `check` attribute can be used to set whether or not types are checked.
45 Please report any bugs or feature requests on the bugtracker website
46 [https://github.com/chazmcgarvey/Return-Type-Lexical/issues](https://github.com/chazmcgarvey/Return-Type-Lexical/issues)
48 When submitting a bug or request, please include a test-file or a
49 patch to an existing test-file that illustrates the bug or desired
54 Charles McGarvey <chazmcgarvey@brokenzipper.com>
56 # COPYRIGHT AND LICENSE
58 This software is copyright (c) 2020 by Charles McGarvey.
60 This is free software; you can redistribute it and/or modify it under
61 the same terms as the Perl 5 programming language system itself.