|Perl: the Markov chain saw|
Nevermind I misread your question as already having the path. Sorry.
The latter is explicitly talking about avoiding the shell and both offer passing arguments explicitly.
I'm not aware of safe placeholder invocations, and the variety of possible CLI arguments is huge.
But you could consider to examine and untaint your file argument.
-e $file should tell you if it exists (hence not work with evil injections) and examining the path should tell you if it's inside an allowed location.
In reply to Re: Safely capturing the output of an external program