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

Re: Tainted coderefs and other things

Thread Previous | Thread Next
From:
Ævar Arnfjörð Bjarmason
Date:
April 29, 2007 07:48
Subject:
Re: Tainted coderefs and other things
Message ID:
51dd1af80704290748r30bd2f30pc5b49532155427df@mail.gmail.com
On 4/29/07, Andy Lester <andy@petdance.com> 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About