Safe::HoleSafe::Hole is a Perl module to make a hole to the original main compartment in the Safe compartment. | |
Download |
Safe::Hole Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Sey Nakajima and Brian McCauley
- Publisher web site:
- http://search.cpan.org/~seyn/Safe-Hole-0.10/Hole.pm
Safe::Hole Tags
Safe::Hole Description
Safe::Hole is a Perl module to make a hole to the original main compartment in the Safe compartment. Safe::Hole is a Perl module to make a hole to the original main compartment in the Safe compartment.SYNOPSIS use Safe; use Safe::Hole; $cpt = new Safe; $hole = new Safe::Hole {}; sub test { Test->test; } $Testobj = new Test; # $cpt->share('&test'); # alternate as next line $hole->wrap(&test, $cpt, '&test'); # ${$cpt->varglob('Testobj')} = $Testobj; # alternate as next line $hole->wrap($Testobj, $cpt, '$Testobj'); $cpt->reval('test; $Testobj->test;'); print $@ if $@; package Test; sub new { bless {},shift(); } sub test { my $self = shift; $self->test2; } sub test2 { print "Test->test2 calledn"; }We can call outside defined subroutines from the Safe compartmentusing share(), or can call methods through the object that is copiedinto the Safe compartment using varglob(). But that subroutines ormethods are executed in the Safe compartment too, so they cannot callanother subroutines that are dinamically qualified with the packagename such as class methods nor can they compile code that uses opcodesthat are forbidden within the compartment.Through Safe::Hole, we can execute outside defined subroutines in the original main compartment from the Safe compartment. Note that if a subroutine called through Safe::Hole::call does aCarp::croak() it will report the error as having occured withinSafe::Hole. This can be avoided by including Safe::Hole::User in the@ISA for the package containing the subroutine. Requirements: · Perl
Safe::Hole Related Software