in reply to my script is not giving the result using last function

What have you done to debug this problem? At what position in the string does the "non-A" character get found? What character gets found?

I suggest printing the progress through the string, the position and the length of the string while your loop runs.

Consider reading readline and chomp.

  • Comment on Re: my script is not giving the result using last function