Skip Menu |

This queue is for tickets about the Safe CPAN distribution.

Report information
The Basics
Id: 38310
Status: resolved
Priority: 0/
Queue: Safe

People
Owner: RGARCIA [...] cpan.org
Requestors: tod222 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.16
Fixed in: (no value)



Subject: reval defaults to 'no strict' without using undocumented argument
The description of the reval method summarizes the arguments as 'reval (STRING)' instead of the correct 'reval (STRING, STRICT)'. Thus, when the STRICT arg is omitted, lexless_anon_sub gets called with undef which causes the "$_[1] ? 'use' : 'no'" clause to default to 'no'. I've attached a small patch that updates the description of reval to correctly describe the behavior with emphasis on the default of 'no strict;'.
Subject: Safe_pm_pod_update.patch
--- Safe.pm.orig 2008-03-13 06:49:12.000000000 -0400 +++ Safe.pm 2008-08-07 21:48:59.000000000 -0400 @@ -486,7 +486,7 @@ ${$cpt->varglob('foo')} = "Hello world"; -=item reval (STRING) +=item reval (STRING, STRICT) This evaluates STRING as perl code inside the compartment. @@ -513,6 +513,10 @@ where earlier versions of perl made it hard to mimic the return behaviour of the eval() command and the context was always scalar. +The formerly undocumented STRICT argument sets strictness: if true +'use strict;' is used, otherwise it uses 'no strict;'. B<Note>: if +STRICT is omitted 'no strict;' is the default. + Some points to note: If the entereval op is permitted then the code can use eval "..." to
Thanks, I've applied your patch to the perl 5 source repository and it will be available in the next CPAN version of Safe. (change #34222)