Acme::SafetyGoggles - Protects programmer's eyes from source filtering
Version 0.06
$ perl -MAcme::SafetyGoggles possibly_dangerous_script.pl
Is some module you imported using source filtering? If the answer is yes, or if the answer is "I don't know", then you can't trust the code in front of your own eyes!
That's why you should always use patent-pending Acme::SafetyGoggles in your untrusted Perl code. Acme::SafetyGoggles compares your original source file with the code that is actually going to be run, and alerts you to any differences.
Acme::SafetyGoggles
Returns this module's assessment of whether the source code of the current program has been modified. Return value is either "safe" or "unsafe".
"safe"
"unsafe"
If source code modification has been detected, returns the result of the Text::Diff::diff call between the pure and the modified source. This output will remind you of the output of the Unix diff command.
Text::Diff::diff
diff
Acme::SafetyGoggles can only (maybe) protect you from source filtering. It is not designed or warranted to protect you from improper use of any other potentially dangerous or evil Perl construction.
Acme::SafetyGoggles does not operate on code specified by perl's -e command line option.
-e
Acme::SafetyGoggles may yield a false positive if the input turns source code filtering on and off with calls to use XXX::SourceFilter ... no XXX::SourceFilter, or in other files where the source filter has a limited scope.
use XXX::SourceFilter
no XXX::SourceFilter
trustable_code(); use The::Source::Filter; some_code_you_cant_trust(); no The::Source::Filter; more_trustable_code(); trustable_code(); { use The::Source::Filter; some_code_you_cant_trust(); } more_trustable_code();
This module really only works on source filters that already use the Filter::Simple mechanism. Even then, there are probably still a lot of ways to source filter the code so that it won't be detected by this module.
Please report any other bugs or feature requests to bug-acme-safetygoggles at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-SafetyGoggles. I will be notified, and then you'll automatically be given a commit bit for this distribution on PAUSE. Um, I mean that you'll automatically be notified of progress on your bug as I make changes.
bug-acme-safetygoggles at rt.cpan.org
Marty O'Brien, <mob at cpan.org>
<mob at cpan.org>
You can find documentation for this module with the perldoc command.
perldoc Acme::SafetyGoggles
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-SafetyGoggles
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Acme-SafetyGoggles
CPAN Ratings
http://cpanratings.perl.org/d/Acme-SafetyGoggles
Search CPAN
http://search.cpan.org/dist/Acme-SafetyGoggles/
Inspired by comments on source filtering from stackoverflow.com's Ether: http://stackoverflow.com/questions/2818155/#2819871
Copyright 2010,2013 Marty O'Brien.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Acme::SafetyGoggles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::SafetyGoggles
CPAN shell
perl -MCPAN -e shell install Acme::SafetyGoggles
For more information on module installation, please visit the detailed CPAN module installation guide.