Dist::Zilla::Plugin::Comment - Comment-out lines or blocks of lines
This document describes version 0.02 of Dist::Zilla::Plugin::Comment (from Perl distribution Dist-Zilla-Plugin-Comment), released on 2016-12-25.
In dist.ini:
dist.ini
[Comment]
In lib/Foo.pm:
lib/Foo.pm
... do_something(); # COMMENT # BEGIN_COMMENT one(); two(); three(); # END_COMMENT =pod =for BEGIN_COMMENT blah blah blah =for END_COMMENT ...
After build, lib/Foo.pm will become:
... ## do_something(); # COMMENT # BEGIN_COMMENT ## one(); ## two(); ## three(); # END_COMMENT =pod =for BEGIN_COMMENT ## blah ## blah ## blah =for END_COMMENT ...
This plugin finds lines that end with # COMMENT, or blocks of lines delimited by # BEGIN COMMENT ... # END_COMMENT or =for BEGIN_COMMENT ... =end END_COMMENT and comment them out.
# COMMENT
# BEGIN COMMENT
# END_COMMENT
=for BEGIN_COMMENT
=end END_COMMENT
This can be used, e.g. to do stuffs only when the source file is not the dzil-built version, usually for testing.
Please visit the project's homepage at https://metacpan.org/release/Dist-Zilla-Plugin-Comment.
Source repository is at https://github.com/perlancar/perl-Dist-Zilla-Plugin-Comment.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Comment
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.
You can use this plugin in conjunction with Dist::Zilla::Plugin::InsertBlock. DZP:InsertBlock can insert lines that will only be available in the dzil-built version. While for the raw version, you can use DZP:Comment plugin to make lines that will be commented-out in the dzil-built version.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::Comment, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Comment
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Comment
For more information on module installation, please visit the detailed CPAN module installation guide.