in reply to Re: Insecure dependency error and $ENV{'PATH'}
in thread Insecure dependency error and $ENV{'PATH'}

Thanks Ovid, et al! Totally my bad (thanks for not -- me too badly—oh, the joys of programming). $branch was the culprit and had nothing to do with $ENV{'PATH'} or $newfile. But did take the advice of diotalevi and captured potential errors ($branch is set by me so not a hazard). Revised code:
$branch =~ /^([\w-]+)$/i; $branch = $1; if ($sourcefile =~ /([\w .-]+)$/i) {; #strip off path stuff $newfile = $1; } else { return("Bad file name"); } open (OUTFILE, ">../$branch/images/$newfile") or die "Cannot open $new +file: $!"; ...

—Brad
"Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton

Replies are listed 'Best First'.
•Re^3: Insecure dependency error and $ENV{'PATH'}
by merlyn (Sage) on Aug 05, 2004 at 17:32 UTC
      Thanks for the gentle reprimand merlyn. I did state that I controlled $branch, but I do now see how it could get hacked anyway. Your point is well-taken.

      —Brad
      "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton