if ($filename =~ m/(...)/) { $filename = $1; # weiter } else { die ...; } # vs. my ($untainted) = $filename =~ m/(...)/; if ($untainted) { # weiter } else { die ...; }