When you refer to "store each one in a variable", the involved concept here is array. You may split the words of NAMELIST variable into 3 array elements this way:
setlocal EnableDelayedExpansion
set i=0
for %%a in (%namelist%) do (
set /A i=i+1
set VAR!i!=%%a
)
This way, you may use each array element directly:
perl.exe C:\action.pl %VAR1%
perl.exe C:\action.pl %VAR2%
perl.exe C:\action.pl %VAR3%
Or, in a simpler way using a loop:
for /L %%i in (1,1,3) do perl.exe C:\action.pl !VAR%%i!
EDIT: You may use this method with an unlimited number of values in the NAMELIST variable, just use the previous value of %i% instead the 3 (better yet, change it by "n"). I also suggest you to use the standard array notation this way: VAR[%%i]
:
setlocal EnableDelayedExpansion
set namelist=AAA BBB CCC DDD EEE FFF
set n=0
for %%a in (%namelist%) do (
set /A n+=1
set VAR[!n!]=%%a
)
for /L %%i in (1,1,%n%) do perl.exe C:\action.pl !VAR[%%i]!