I don't see anything wrong in the dumps, and you didn't point out anything specific (Update: OP has since been updated to include expected+actual values), but these two tips should help.
Don't pass globals to functions that may modify them. (I consider anything in perlvar unsafe.)
$wdir = File::Spec->catfile($cdir, $1); # Bad $wdir = File::Spec->catfile($cdir, "$1"); # Good, $1 is copied.
Avoid using $1, $2, anywhere except immediately after where they are set, and only to copy them. This may not be necessary, but it is definitely safe, worry-free and better than using variables with meaningless names.
By the way, your untainting is rather arbitrary (it ignores anything starting with the first \x0A) and defies the whole idea of tainting (it allows everything else including \x00).
In reply to Re: Tainting problem on Strawberry perl
by ikegami
in thread Tainting problem on Strawberry perl
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |