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, but type-checking can be
33 enabled and disabled within lexical scopes.
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
46 Please report any bugs or feature requests on the bugtracker website
47 https://github.com/chazmcgarvey/Return-Type-Lexical/issues
49 When submitting a bug or request, please include a test-file or a patch
50 to an existing test-file that illustrates the bug or desired feature.
54 Charles McGarvey <chazmcgarvey@brokenzipper.com>
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.