in reply to Spliting letters in a string

I'm going to guess that the variable names being the same thing as the letters they contained was only a coincidence (although, perhaps an intentional one) and that you really meant that you just wanted each letter of the string to be in a separate variable.

In that case, you don't need to bother with a hash: just use an array. Like so:

@letters = split //, $string;

If you did use a hash, you'd have to use keys to find out what letters were in the string and would end up getting back an array anyway. Plus, the letters would be irrevocably out of order. That doesn't seem like a useful solution any way around.

Of course, my solution counts each single whitespace and punctuation character as a letter, which may not be what you want. <update>But then, so do all the other solutions presented so far. ;-P</update> I still think it's closer to what you meant, though.

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.