You usually untaint by matching "nice" stuff and using $1:
if( $temp =~ m#([-\w./]*)# ) { # or if( $temp =~ m#^(/?(?:[-\w.]+/)*[-\w.]*)$# ) { $temp= $1; } else { die "Invalid input..."; }
The die may not be the proper way to fail, depending on your environment.
- tye (but my friends call me "Tye")In reply to (tye)Re: Untainted done right!
by tye
in thread Untainted done right!
by SilverB1rd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |