]> Dogcows Code - chaz/p5-Return-Type-Lexical/blob - README
Version 0.002
[chaz/p5-Return-Type-Lexical] / README
1 NAME
2
3 Return::Type::Lexical - Same thing as Return::Type, but lexical
4
5 VERSION
6
7 version 0.002
8
9 SYNOPSIS
10
11 use Return::Type::Lexical;
12 use Types::Standard qw(Int);
13
14 sub foo :ReturnType(Int) { return "not an int" }
15
16 {
17 no Return::Type::Lexical;
18 sub bar :ReturnType(Int) { return "not an int" }
19 }
20
21 my $foo = foo(); # throws an error
22 my $bar = bar(); # returns "not an int"
23
24 # Can also be used with Devel::StrictMode to only perform
25 # type checks in strict mode:
26
27 use Devel::StrictMode;
28 use Return::Type::Lexical check => STRICT;
29
30 DESCRIPTION
31
32 This module works just like Return::Type, but type-checking can be
33 enabled and disabled within lexical scopes.
34
35 There is no runtime penalty when type-checking is disabled.
36
37 METHODS
38
39 import
40
41 The check attribute can be used to set whether or not types are
42 checked.
43
44 BUGS
45
46 Please report any bugs or feature requests on the bugtracker website
47 https://github.com/chazmcgarvey/Return-Type-Lexical/issues
48
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.
51
52 AUTHOR
53
54 Charles McGarvey <chazmcgarvey@brokenzipper.com>
55
56 COPYRIGHT AND LICENSE
57
58 This software is copyright (c) 2020 by Charles McGarvey.
59
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.
62
This page took 0.034241 seconds and 4 git commands to generate.