0
I Use This!
Inactive

Commits : Individual Commit

Analyzed about 10 hours ago. based on code collected about 10 hours ago.

Commit ID 031936f8a7e6dc09eb63cfbc391b4e1a2ab8b27c

Anon80 Contributor: Torsten Förtsch Files Modified 14
Date: 06-May-2014 at 12:17 Lines Added: 174
Repository: git://github.com/miyagawa/CGI-Compile.git master Lines Removed: 16
Commit Comment: redo %SIG, exit code and internal var handling #12 * Fix %SIG localization Previously, %SIG was localized by local *SIG=+{%SIG}. Although that localizes the hash, its values loose their magic. Hence, setting $SIG{$sig}=\&handler does not work anymore as expected. This change localizes the values instead of the hash itself like local @SIG{keys%SIG}=values %SIG. * Fix exit code handling inconsistencies Previously, if the script simply ended without calling exit, the generated sub returned the result of the last statement of the script. However, if the script called exit, the sub returned undef on exit 0 or died with a exited nonzero: ... message. This is inconsistent. exit $rc or simply $rc at the end of the script should behave identical. * Solutions might be: 1. never die, even if the script itself dies on something else than exit. That would be most consistent with the operating system shell. But the shell does not know about Perl exceptions. 2. propagate exceptions other than exit and return the exit value no matter if it's 0 or else. 3. propagate exceptions other than exit and throw an exception if the script's exit status is something other than 0. Return normal only if the script returns or exits with 0. Here an additional decision that has to be made is whether '' or undef are taken as 0 as the shell would do or not. The proposed change implements 2. and converts the script's return/exit code to a number. So, '' and undef are taken as 0. * Fix variable exposure Previously, lexical variables in compile() were exposed to the script and the variable names were not very obfuscated. So, clashes with not well-written scripts could happen. This is fixed. * Tested on: 1. debian wheezy with the system's Perl 5.14.2 2. a self-built Perl 5.18.0 on openSuse 12.2

Changes by Language

Language Code Added Code Removed Comments Added Comments Removed Blanks Added Blanks Removed
  Perl 78 16 55 0 41 0

Changes by File

File Language Code Added Code Removed Comments Added Comments Removed Blanks Added Blanks Removed
Build.PL Perl 1 1 1 0 0 0
Changes   No source code was detected in this file.
.gitignore   No source code was detected in this file.
lib/CGI/Compile.pm Perl 17 14 50 0 26 0
LICENSE   No source code was detected in this file.
META.json   No source code was detected in this file.
README.md   No source code was detected in this file.
t/compile.t Perl 2 1 1 0 1 0
t/data_end.t Perl 25 0 0 0 6 0
t/eval-my-variables.t Perl 11 0 1 0 3 0