Perl Security: 4. Handling tainted data Turning on taint checking When calling your script, do it with perl -T script.pl Make the first line of your script be #!/usr/bin/perl -T Taint checking will automatically (and always) be applied to scripts having the SUID or SGID bits on. Once Perl is working in taint checking mode, it never goes back. Strong suggestion: Go take a look at perldoc perlsec