Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: File input not working properly?

by hipowls (Curate)
on Apr 22, 2008 at 06:38 UTC ( #682092=note: print w/ replies, xml ) Need Help??


in reply to File input not working properly?

  • Your script check equality of passwords, not username password pairs.
  • If the given password doesn't match the password in the first line then it dies
Your loop needs to be more like
while ( my $line = <$fh> ) { chomp $line; my ( $name, $passwd ) = split /:/, $line; next unless $name eq $userName; .... }

You mak also want to look at Term::ReadKey or IO::Prompt for the password prompt


Comment on Re: File input not working properly?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2015-07-04 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls