Nevermind I misread your question as already having the path. Sorry.
Maybe have a look at IPC::Open3 and IPC::Run
The latter is explicitly talking about avoiding the shell and both offer passing arguments explicitly.
Untested!
Hi
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.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: Safely capturing the output of an external program
by LanX
in thread Safely capturing the output of an external program
by AppleFritter
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |