You can use @lines = <FILE> to get all the lines of a file in an array.
You start off declaring variables with my, but then suddenly stop. Carry on doing it; also, use strict and don't use barewords like $cusr=bob, instead use $cusr='bob'.
In my opinion, it's clearer to use <STDIN> whenever you're reading from standard input, apart from when you're using magic while (<>)