This is an "outlier" situation and we are getting off topic from the thread. The OP wants to call program2 from program1 and pass some command line arguments to program2, possibly derived from command line arguments to program1. There is no need here for a local @ARGV.