sub verify { # open FILE, "$user_file" || die "Can't open user's login files: $!"; # the previous line doesn't obey operator precedence rules # see `perldoc perlop` # as well as it uses "" for nothing.. open FILE, $user_file or die "... $!"; while() { my ($user,$pass)=split(/\|/); # foreach $user($user) { # the previous line does exactly nothing but aliasing $user # to $user, that's really quite useless # See `perldoc perlsyn` # if ($user eq $q->param('ueq &encrypt_pass) { # hmm? i try to guess this might be if( $user eq $q->param('u') ){ # &good; # you're calling a sub and i'm sure you don't know what the # & means and does. See `perldoc perlsub` # Apart from that this routine will sometime return and # you want to go on reading the file then? # } else { &bad; # same problem + you will call 'bad' for every name in the # file that doesn't equal the submitted username. # Is that your intention? } } } close FILE; }