On Sat, Dec 06, 2014 at 05:48:36PM +0300, Артём Варнайский wrote:
>  Hello again! 
> Prompt me please elegant and 'vanilla' way to taint some scalar. My vars lost 
> their taint when I just split external string with regexp on param/val pairs, 
> without checking them for correctness.
> And What do you say about this:
> $foo.=substr($ENV{PATH},0,0); #$foo tainted if $ENV{PATH} is tainted
> Thank, and sorry for my runglish :)

I'm not sure whether there is a more elegant or more vanilla way to do
that.  Appending the zero length substr is also the way it is done in
the perl core.

You would normally take the substr from the original string before
splitting it, unless you wanted to taint $foo even if its source wasn't
tainted.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to