Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: adding to hash/writing to file errors

by chrism01 (Friar)
on May 06, 2008 at 05:50 UTC ( [id://684864]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://684864]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-26 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found