$foo = '123456';
@items = reverse(split //,$foo);
foreach $item (@items){
$i++;
$temp = 'item'.$i;
$$temp = $item;
print"$$temp\n";
}
Though, if you don't *need* having the items in their own
individual variables, you can skip the foreach loop and
simply use @items.