CodeGen::Protection::Format::HTML - Safely rewrite parts of HTML documents
version 0.06
my $rewrite = CodeGen::Protection::Format::HTML->new( protected_code => $text, ); say $rewrite->rewritten; my $rewrite = CodeGen::Protection::Format::HTML->new( existing_code => $existing_code, protected_code => $protected_code, ); say $rewrite->rewritten;
This module allows you to do a safe partial rewrite of documents. If you're familiar with DBIx::Class::Schema::Loader, you probably know the basic concept.
Note that this code is designed for HTML documents and is not very configurable.
In short, we wrap your "protected" (protected_code) HTML code in start and end comments, with checksums for the code:
protected_code
#<<< CodeGen::Protection::Format::HTML 0.01. Do not touch any code between this and the end comment. Checksum: fa97a021bd70bf3b9fa3e52f203f2660 # protected HTML goes here #>>> CodeGen::Protection::Format::HTML 0.01. Do not touch any code between this and the start comment. Checksum: fa97a021bd70bf3b9fa3e52f203f2660
If existing_code is provided, this module removes the code between the old code's start and end markers and replaces it with the protected_code. If the code between the start and end markers has been altered, it will no longer match the checksums and rewriting the code will fail.
existing_code
Curtis "Ovid" Poe <ovid@allaroundtheworld.fr>
This software is copyright (c) 2021 by Curtis "Ovid" Poe.
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 CodeGen::Protection, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CodeGen::Protection
CPAN shell
perl -MCPAN -e shell install CodeGen::Protection
For more information on module installation, please visit the detailed CPAN module installation guide.