Did your $ptr = 1 line really work on your machine? It didn't on mine.
At least your new code is correct... ;) BTW, if you use the -1 index on array, you don't need to shift @array in the loop -- that's the version I'd prefer in production code.
Anyways, it was just fun looking at alternatives. It's not often I see a clean use of type globs!
In reply to Re: Re^3: setting hash keys by array
by blssu
in thread setting hash keys by array
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |