in reply to Calling variables from another file

I'm assuming you mean Environment variables when you say "variables from this .cmd file".

If this is the case, you can try to get them thus:

open (CMDFILE,'cmdfile.cmd & SET |' ) or die "Cant run cmd"; while(<CMDFILE>){ print qq(EnvVar:$_) ## Look for the variables you want values for };
Your perl program will obtain all STDOUT output produced by "cmdfile.cmd" , followed by all available environment variables. This output can now be parsed to get desired info.

    Earth first! (We'll rob the other planets later)