$v1 is correct.
If you set %a to $readn then you will always $read the same line. Your script should get stuck in an infinite loop due to this, although I don't see you mentioning that.
Setting %a to $readn +1 should fix that.