# this is properly placed where perl can find it use Mymodules::Auth; use strict; use warnings; print "Username: "; my $username = STDIN; chomp $username; ReadMode('noecho'); print "Password: " my $passwd = STDIN; chomp($passwd); ReadMode('restore'); # somehow pass $username and $password to # Mymodules::Auth and the subroutine auth # this will return 0 or 1. my $auth = Mymodules::Auth->auth($username, $passwd);