I have a hash stored as a Data::Dumper file. When I try to eval this file into my program to rebuild the hash, I am running afoul of the taint checker.
"Insecure dependency in eval while running with -T switch at line .... <USRHASH> chunk 1."
The string being evaled to recreate the hash can be any length, so I can't do "standard" de-tainting by substr out the individual fields. The Code looks like:
open(USRHASH,"<$usrhash") or die ......;
flock(USRHASH, LOCK_SH) or die..........;
$/=undef;
eval <USRHASH>;
close (USRHASH);
$/="\n";
my %newhash=%$USRLST1; # the reference as created by Data::Dumper
I am hoping someone out there has "laundered" an eval somehow.
TIA.
gassho
"I don't believe in an afterlife, but I am taking a change of underwear." ---Woody Allen
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.