In perldoc's re pragma documentation - use re 'taint' section stands:
This feature is useful when regexp operations on tainted data aren't meant to extract safe substrings, but to perform other transformations.and additionaly:
...values returned by the m// operator in list context...So operation like this:
does not remove taint flag from $1 and $2 values. Everything as expected.my $var = $ARGV[0]; ## $var is tainted and has value 'aabb'; { use re 'taint'; $var =~ m/(aa)(bb)/; }
But similar operation:
removes taint flag from both $1 and $2 values.my $var = $ARGV[0]; ## $var is tainted and has value 'aabb'; { use re 'taint'; $var =~ s/(aa)(bb)/$1/; }
Shouldn't this produce the same result? I know documentation says "values returned by the m// operator" but...
Or maybe there is another way for s/// operator to behave like m// with use re 'taint'?
In reply to use re 'taint' with s/// operator by Pirax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |