I have a an old csh script (which hopefully I have time to rewrite in perl) which has a series of variables wmr1, wmr2 ... wmr24. What I would like to do is echo the values of each variable using a foreach loop eg
foreach i(`seq 1 24`)
echo ${wmr$i}
end
Can this be done in csh or using a perl one liner (using a symbolic refernce?)? I am not sure how to combine the integer $i
with wmr
and output the value of $wmr1
$wmr2
etc. echo ${wmr$i}
in the loop gives me the error Missing }.