Modified the perl script to support arrays of variables.