in reply to Modifying command line

You can do this from C but I don't know if you can from Perl. See this for how to do it in C. It is not secure due to the race condition. Neither is setting an environment variable and then executing your code. Taking the data from a file, stream or prompt are the only secure ways.