This is from the Safe docs:
By default, the only variables shared with compartments are the =
"underscore" variables $_ and @_ (and, technically, the less frequently =
used %_, the _ filehandle and so on). This is because otherwise perl =
operators which default to $_ will not work and neither will the =
assignment of arguments to @_ on subroutine entry.=20
So $0 would not be available unless explicitly shared. If this is
a problem, $0 could always be added to
%VARS_SHARED_WITH_SAFE_COMPARTMENT in Log/Log4perl.pm
Regards.
--
j.
James FitzGibbon =20
Consultant, Ajilon Services, TTS-3D@CC-950=20
jam...@ta...
voice/fax 612-304-6121/3277
> -----Original Message-----
> From: Mike Schilli [mailto:log...@pe...]
> Sent: Monday, July 07, 2003 6:45 PM
> To: Log4perl Devel Mailing List; James.FitzGibbon
> Cc: Tim...@ig...
> Subject: $0 not defined in Safe.pm?
>=20
>=20
> Hi all,
>=20
> just saw that there's a warning message coming out of=20
> Log4perl's test case
> t/041SafeEval.t and it boils down to that $0 is not available in Safe
> compartments, this snippet
>=20
> use Safe;
> my $safe =3D Safe->new();
> $safe->reval('print "\$0 is $0\n"');
>=20
> won't show anything for $0. This results in stat() being called with a
> undef argument in
>=20
> log4perl.appender.Main.filename =3D \
> sub { "example" . (stat($0))[9] . ".log" }
>=20
> if Log4perl's Safe compartments are used. Does anyone know if=20
> this is a bug
> in Safe?
>=20
> -- Mike
>=20
> Mike Schilli
> log...@pe...
> http://perlmeister.com
> http://log4perl.sourceforge.net
>=20
|