in reply to What's wrong with my code? [from a beginner]

Another thing you will want is to review the difference between numeric comparison and string comparison ( "==" vs "eq", see perlintro )

if ($entry[1] == "r") # true if $entry[1] is '0', or 'r', or 'z'! if ( $entry[1] eq "r" ) # true if $entry[1] is "r"
use warnings; will point that out for you when the script runs.