perldoc perlsec explains why the above mentioned fix works.
In reply to Re: Taint mode errror by Fletch in thread Taint mode errror by Anonymous Monk