in reply to A memory problem?

To capture a match in $1, you need to stick it between ()s; your regexp should be:

/^([a-zA-Z]+)$/

the lowliest monk