Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Variable/if question...

by mkmcconn (Chaplain)
on Nov 04, 2001 at 12:24 UTC ( [id://123153]=note: print w/replies, xml ) Need Help??


in reply to Variable/if question...

Indomitus beat me to the submit button, I see.

if($pword eq $cpword){ open (FILE, "< memberlist.txt") or die $!; while(<FILE>){ push @lines,$_; } close FILE or die $!; }
  • You'll be able to zero in on problems like this if you habitually use the die statement, to test whether you've had success.
  • Unless your passwords are numeric, you'll want to test equivalence with 'eq', unstead of '=='.
  • And finally - your code closed the filehandle inside of your while loop (another thing that die would have told you).

mkmcconn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found