Tie::InSecureHash - A tied hash that is API compatible with Tie::SecureHash with namespace-based encapsulation features disabled. This is for debugging. Typically you'll use this in the following manner:
#!/usr/bin/env/perl; use warnings; use strict; use lib 't/go_away'; use Tie::SecureHash;
Then in t/go_away:
package Tie::SecureHash; use base Tie::InSecureHash; 1;
Now you can use things like Devel::Cycle (temporarily) in your code ...
This code derived form v1.03 of Tie::SecureHash released in 1999.
use Tie::SecureHash; # CREATE AN INSECURE HASH my %hash; tie %hash, Tie::InSecureHash; # CREATE A REFERENCE TO AN INSECURE HASH (BLESSED INTO Tie::InSecureHash!) my $hashref = Tie::InSecureHash->new(); # CREATE A REFERENCE TO A INSECURE HASH (BLESSED INTO $some_other_class) my $hashref = Tie::InSecureHash->new($some_other_class); # CREATE NEW ENTRIES IN THE HASH package MyClass; sub new { my ($class, %args) = @_ my $self = Tie::InSecureHash->($class); $self->{MyClass::public} = $args{public}; $self->{MyClass::_protected} = $args{protected}; $self->{MyClass::__private} = $args{private}; return $self; } # SAME EFFECT, EASIER SYNTAX... package MyClass; sub new { my ($class, %args) = @_ my $self = Tie::InSecureHash->($class, public => $args{public}, _protected => $args{protected}, __private => $args{private}, ); return $self; }
There are none. This code is for debugging only :P
Damian Conway (damian@cs.monash.edu.au)
Swathes of code deletions by Kieren Diment <zarquon@cpan.org> with help from Glenn Fowler (CEBJYRE).
None here :P
Copyright (c) 1998-2000, Damian Conway. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
To install Tie::InSecureHash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::InSecureHash
CPAN shell
perl -MCPAN -e shell install Tie::InSecureHash
For more information on module installation, please visit the detailed CPAN module installation guide.