#!/usr/bin/perl -T use File::Spec; use Scalar::Util; my $pathdir = $ENV{HOME}; # tainted, existing dir, absolute path (-d $pathdir) and File::Spec->file_name_is_absolute($pathdir); my $stuff = File::Spec->canonpath("foo/bar"); print "\nerror $stuff is tainted\n" if Scalar::Util::tainted($stuff); sub foo { open(BAREWORD, "