Update: Doh, I misread $text = "go" as $text == "go" sorry !
You don't seem to have initialized the value $text with anything at all here? Did you want it to contain the value from the line in the file? ( $text = $_ or foreach $text (<FILE>) )
This is almost certainly the reason for the uninitialized value in pattern match errors, and hence the uninitialized in concatenation since $count is never initialized as $text is never defined.