Is script1.pl calling script2.pl? If not, are both programs running at the same time? If not, does your question make any sense? If one script is calling the other, can't you just pass the array as parameters? Or else, use shared memory/a file/a database/a pipe/a socket to pass information back and forth. See man perlipc.