in reply to Trying to take user input as username, read etc/passwd and output user ID

Hello charlesx1552 and welcome to the monastery and to the wonderful world of perl!

Without entering in the matter of checking linux users (you got already authoritative suggestions) I'd like to point you to some general perl modern practices:

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.