in reply to Re: adding to hash/writing to file errors
in thread adding to hash/writing to file errors

If you really want to pass your hash around

login($username, %logins);

then the start of the login sub should be

my $username = shift; my %logins = @_;
and this
if ($pass <=> $logins{$username})
becomes
if( $pass eq $logins{$username} )
ie use a string comparison operator.
http://perldoc.perl.org/perlop.html#Equality-Operators

Numeric test:

if ($selection == "1")
becomes
if ($selection == 1)
Cheers
Chris