5

Perl 5 supports taint mode with the -T switch. The script will internally mark any value that is retrieved from a source external to the script as tainted which should be untainted. Does Perl 6 support such an option?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
smith
  • 3,232
  • 26
  • 55

2 Answers2

5

No.

Such a feature is briefly mentioned in design docs. The suggestion is introduction of a taint trait.

You can see the latest comments by Larry Wall about this (and any other topic) by searching the #perl6 logs. Mentions of 'taint' by TimToady reveal "we have no tainting mechanism yet to prevent abuse" in December.

raiph
  • 31,607
  • 3
  • 62
  • 111
1

Perl 5 will mark a Scalar container as tainted and that taint may or may not spill into other containers. The reason why it doesn't stick to values put into Arrays is that Perl 5 is using the very same Arrays to keep it's own data around. The performance hit would have been to big to make tainted mode work properly.

As you likely have guess already, tainted mode joined the Dodo. Instead you could use a restricted setting. See the code for Camelia how it's done.