You have to initialize $i.$direction = 1; #set to -1 to go to opposite direction @array = split(//, $string); for (@array) { print $array[$i]; $i = ($i + $direction) % ($#array + 1); };
UPDATED: Added $direction (I think I was going backwards first)
In reply to Re: PUZZLED
by Punto
in thread PUZZLED
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |