package Mymodules::Auth; use strict; use warnings; sub auth { my $username = shift @_; my $passwd = shitf @_; # here I would use DBI to get the password # and username from a database . . . if ($db-passwd eq $passwd){ $auth = 1; return $auth; }else{ $auth = 0; return $auth; } } 1;