If the serializer can optionally untaint any retrieved data subject to
taint checks in Perl, this can be used to request that feature. Data
that comes from external sources (like disk-files) must always be
viewed with caution, so use this only when you are sure that that is
not an issue.
<P><STRONG>Data::Dumper</STRONG> uses <A HREF="../../lib/Pod/perlfunc.html#item_eval"><CODE>eval()</CODE></A> to deserialize and is therefore subject to
taint checks. Can be set to a true value to make the <STRONG>Data::Dumper</STRONG>
serializer untaint the data retrieved. It is not enabled by default.
Use with care.</P>
<P><STRONG>Storable</STRONG> and <STRONG>FreezeThaw</STRONG> do not honor this attribute.</P>
<P></P></DL>
<P>
<HR>
<H1><A NAME="examples">EXAMPLES</A></H1>
<P>Here is a simple example. Note that does not depend upon the underlying
serializing package--most real life examples should not, usually.</P>
<PRE>
use MLDBM; # this gets SDBM and Data::Dumper
#use MLDBM qw(SDBM_File Storable); # SDBM and Storable
use Fcntl; # to get 'em constants
</PRE>
<PRE>
$dbm = tie %o, 'MLDBM', 'testmldbm', O_CREAT|O_RDWR, 0640 or die $!;</PRE>
<PRE>
$c = [\ 'c'];
$b = {};
$a = [1, $b, $c];
$b->{a} = $a;
$b->{b} = $a->[1];
$b->{c} = $a->[2];
@o{qw(a b c)} = ($a, $b, $c);</PRE>
<PRE>
#
# to see what was stored
#
use Data::Dumper;
print Data::Dumper->Dump([@o{qw(a b c)}], [qw(a b c)]);</PRE>
<PRE>
#
# to modify data in a substructure
#
$tmp = $o{a};
$tmp->[0] = 'foo';
$o{a} = $tmp;</PRE>
<PRE>
#
# can access the underlying DBM methods transparently
#
#print $dbm->fd, "\n"; # DB_File method</PRE>
<P>Here is another small example using Storable, in a portable format:</P>
<PRE>
use MLDBM qw(DB_File Storable); # DB_File and Storable
</PRE>
<PRE>
tie %o, 'MLDBM', 'testmldbm', O_CREAT|O_RDWR, 0640 or die $!;</PRE>
<PRE>
(tied %o)->DumpMeth('portable'); # Ask for portable binary
$o{'ENV'} = \%ENV; # Stores the whole environment</PRE>
<P>
<HR>
<H1><A NAME="bugs">BUGS</A></H1>
<OL>
<LI>
Adding or altering substructures to a hash value is not entirely transparent
in current perl. If you want to store a reference or modify an existing
reference value in the DBM, it must first be retrieved and stored in a
temporary variable for further modifications. In particular, something like