develooper Front page | perl.perl5.porters | Postings from April 2007

Re: Tainted coderefs and other things

Thread Previous | Thread Next
Ævar Arnfjörð Bjarmason
April 29, 2007 07:48
Re: Tainted coderefs and other things
Message ID:
On 4/29/07, Andy Lester <> wrote:
> Indeed, there is no way to taint any kind of reference.

You can taint a reference without manually flipping the taint flag,
although it doesn't come directly from the outside:

my $str = shift; # $str tainted
my $reg = qr/$str/; # The $reg blessed magic object is tainted
system echo => $reg; # err: $reg is tainted on interpolation

I test for this amongst other things in Taint::Util's t/usage.t test.
It also allows you to taint any reference (including coderefs) but
that's manual mucking around with SV*'s as has been pointed out.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About