in reply to construct variable name on the fly

print ${"var$_"}."\n" for (1..2);

${'var1'} gives the same results as $var1.