]> Dogcows Code - chaz/p5-Return-Type-Lexical/commitdiff
add README
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 10 Mar 2020 04:53:34 +0000 (22:53 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 10 Mar 2020 04:53:34 +0000 (22:53 -0600)
README.md [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..8cd9349
--- /dev/null
+++ b/README.md
@@ -0,0 +1,61 @@
+# NAME
+
+Return::Type::Lexical - Same thing as Return::Type, but lexical
+
+# VERSION
+
+version 0.001
+
+# SYNOPSIS
+
+    use Return::Type::Lexical;
+    use Types::Standard qw(Int);
+
+    sub foo :ReturnType(Int) { return "not an int" }
+
+    {
+        no Return::Type::Lexical;
+        sub bar :ReturnType(Int) { return "not an int" }
+    }
+
+    my $foo = foo();    # throws an error
+    my $bar = bar();    # returns "not an int"
+
+    # Can also be used with Devel::StrictMode to only perform
+    # type checks in strict mode:
+
+    use Devel::StrictMode;
+    use Return::Type::Lexical check => STRICT;
+
+# DESCRIPTION
+
+This module works just like [Return::Type](https://metacpan.org/pod/Return%3A%3AType), but type-checking can be enabled and disabled within
+lexical scopes.
+
+There is no runtime penalty when type-checking is disabled.
+
+# METHODS
+
+## import
+
+The `check` attribute can be used to set whether or not types are checked.
+
+# BUGS
+
+Please report any bugs or feature requests on the bugtracker website
+[https://github.com/chazmcgarvey/Return-Type-Lexical/issues](https://github.com/chazmcgarvey/Return-Type-Lexical/issues)
+
+When submitting a bug or request, please include a test-file or a
+patch to an existing test-file that illustrates the bug or desired
+feature.
+
+# AUTHOR
+
+Charles McGarvey <chazmcgarvey@brokenzipper.com>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2020 by Charles McGarvey.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
This page took 0.019019 seconds and 4 git commands to generate.